<!DOCTYPE html>
<!-- saved from url=(0061)#669b9d47c2 -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    
    <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link href="images/favicon.ico" rel="icon" type="image/ico">
    <title>综合指数交易对信息 – Binance API 使用文档</title>
    <style>
      .highlight table td { padding: 5px; }
.highlight table pre { margin: 0; }
.highlight .gh {
  color: #999999;
}
.highlight .sr {
  color: #f6aa11;
}
.highlight .go {
  color: #888888;
}
.highlight .gp {
  color: #555555;
}
.highlight .gs {
}
.highlight .gu {
  color: #aaaaaa;
}
.highlight .nb {
  color: #f6aa11;
}
.highlight .cm {
  color: #75715e;
}
.highlight .cp {
  color: #75715e;
}
.highlight .c1 {
  color: #75715e;
}
.highlight .cs {
  color: #75715e;
}
.highlight .c, .highlight .cd {
  color: #75715e;
}
.highlight .err {
  color: #960050;
}
.highlight .gr {
  color: #960050;
}
.highlight .gt {
  color: #960050;
}
.highlight .gd {
  color: #49483e;
}
.highlight .gi {
  color: #49483e;
}
.highlight .ge {
  color: #49483e;
}
.highlight .kc {
  color: #66d9ef;
}
.highlight .kd {
  color: #66d9ef;
}
.highlight .kr {
  color: #66d9ef;
}
.highlight .no {
  color: #66d9ef;
}
.highlight .kt {
  color: #66d9ef;
}
.highlight .mf {
  color: #ae81ff;
}
.highlight .mh {
  color: #ae81ff;
}
.highlight .il {
  color: #ae81ff;
}
.highlight .mi {
  color: #ae81ff;
}
.highlight .mo {
  color: #ae81ff;
}
.highlight .m, .highlight .mb, .highlight .mx {
  color: #ae81ff;
}
.highlight .sc {
  color: #ae81ff;
}
.highlight .se {
  color: #ae81ff;
}
.highlight .ss {
  color: #ae81ff;
}
.highlight .sd {
  color: #e6db74;
}
.highlight .s2 {
  color: #e6db74;
}
.highlight .sb {
  color: #e6db74;
}
.highlight .sh {
  color: #e6db74;
}
.highlight .si {
  color: #e6db74;
}
.highlight .sx {
  color: #e6db74;
}
.highlight .s1 {
  color: #e6db74;
}
.highlight .s {
  color: #e6db74;
}
.highlight .na {
  color: #a6e22e;
}
.highlight .nc {
  color: #a6e22e;
}
.highlight .nd {
  color: #a6e22e;
}
.highlight .ne {
  color: #a6e22e;
}
.highlight .nf {
  color: #a6e22e;
}
.highlight .vc {
  color: #ffffff;
}
.highlight .nn {
  color: #ffffff;
}
.highlight .nl {
  color: #ffffff;
}
.highlight .ni {
  color: #ffffff;
}
.highlight .bp {
  color: #ffffff;
}
.highlight .vg {
  color: #ffffff;
}
.highlight .vi {
  color: #ffffff;
}
.highlight .nv {
  color: #ffffff;
}
.highlight .w {
  color: #ffffff;
}
.highlight {
  color: #ffffff;
}
.highlight .n, .highlight .py, .highlight .nx {
  color: #ffffff;
}
.highlight .ow {
  color: #f92672;
}
.highlight .nt {
  color: #f92672;
}
.highlight .k, .highlight .kv {
  color: #f92672;
}
.highlight .kn {
  color: #f92672;
}
.highlight .kp {
  color: #f92672;
}
.highlight .o {
  color: #f92672;
}
    </style>
    <link href="./综合指数交易对信息 – Binance API 使用文档_files/screen.css" rel="stylesheet" media="screen">
    <link href="./综合指数交易对信息 – Binance API 使用文档_files/print.css" rel="stylesheet" media="print">
      <script src="./综合指数交易对信息 – Binance API 使用文档_files/all.js.下载"></script>
  </head>

  <body class="index" data-languages="[]">
    <a href="#" id="nav-button">
      <span>
        <img src="./综合指数交易对信息 – Binance API 使用文档_files/navbar.png" alt="Navbar">
      </span>
    </a>
    <header>
      <div class="flex_box">
        <a href="https://www.binance.com/cn/" class="LG" id="LG"><img src="./综合指数交易对信息 – Binance API 使用文档_files/logo.svg" class="logo" alt="Logo"></a>
        <div class="nav_box">
          <span class="nav_cell" style="display: none">
            <a href="javascript:;" class="nav_first">v1<i class="icon_nav"></i></a>
            //<ul class="nav_ul">
            //  <li>
            //    <a href="https://binance-docs.github.io/apidocs/spot/en/" id="v1_url">v1</a>
            //  </li>
            //  <li>
            //    <a href="https://binance-docs.github.io/apidocs/spot/en/" id="v2_url">v2</a>
            //  </li>
            </ul>
          </span>
          <span class="nav_cell nav_tab">
            <a href="https://binance-docs.github.io/apidocs/spot/cn/" id="btn_spot" class="">现货/杠杆/币安宝/矿池</a>
          </span>
          <span class="nav_cell nav_tab">
            <a href="" id="btn_dm" class="current">U本位合约</a>
          </span>
          <span class="nav_cell nav_tab">
            <a href="https://binance-docs.github.io/apidocs/delivery/cn/" id="btn_fp" class="">币本位合约</a>
          </span>
          <span class="nav_cell nav_tab">
            <a href="https://binance-docs.github.io/apidocs/voptions/cn/" id="btn_tn" class="">欧式期权</a>
          </span>
        </div>
      </div>
      <a href="https://binance-docs.github.io/apidocs/futures/en/" class="lang" id="lang_box" style="display: block;">English</a>
    </header>
    <div class="toc-wrapper">
        <div class="search">
          <input type="text" class="search" id="input-search" placeholder="Search">
        </div>
        <ul class="search-results"></ul>
      <ul id="toc" class="toc-list-h1">
          <li>
            <a href="#185368440e" class="toc-h1 toc-link" data-title="更新日志">更新日志</a>
          </li>
          <li>
            <a href="#b122f813d5" class="toc-h1 toc-link" data-title="基本信息">基本信息</a>
              <ul class="toc-list-h2">
                  <li>
                    <a href="#sdk" class="toc-h2 toc-link" data-title="SDK和代码示例">SDK和代码示例</a>
                  </li>
                  <li>
                    <a href="#rest" class="toc-h2 toc-link" data-title="Rest 基本信息">Rest 基本信息</a>
                  </li>
                  <li>
                    <a href="#testnet" class="toc-h2 toc-link" data-title="testnet">testnet</a>
                  </li>
                  <li>
                    <a href="#12907e94be" class="toc-h2 toc-link" data-title="访问限制">访问限制</a>
                  </li>
                  <li>
                    <a href="#a573a19f9c" class="toc-h2 toc-link" data-title="接口鉴权类型">接口鉴权类型</a>
                  </li>
                  <li>
                    <a href="#trade-user_data" class="toc-h2 toc-link" data-title="需要签名的接口 (TRADE 与 USER_DATA)">需要签名的接口 (TRADE 与 USER_DATA)</a>
                  </li>
                  <li>
                    <a href="#api" class="toc-h2 toc-link" data-title="公开API参数">公开API参数</a>
                  </li>
                  <li>
                    <a href="#cc81fff589" class="toc-h2 toc-link" data-title="过滤器">过滤器</a>
                  </li>
                  <li>
                    <a href="#postman-collections" class="toc-h2 toc-link" data-title="Postman Collections">Postman Collections</a>
                  </li>
              </ul>
          </li>
          <li>
            <a href="#ed913b7357" class="toc-h1 toc-link active-parent" data-title="行情接口">行情接口</a>
              <ul class="toc-list-h2 active" style="display: block;">
                  <li>
                    <a href="#ping" class="toc-h2 toc-link" data-title="测试服务器连通性 PING">测试服务器连通性 PING</a>
                  </li>
                  <li>
                    <a href="#3f1907847c" class="toc-h2 toc-link" data-title="获取服务器时间">获取服务器时间</a>
                  </li>
                  <li>
                    <a href="#0f3f2d5ee7" class="toc-h2 toc-link" data-title="获取交易规则和交易对">获取交易规则和交易对</a>
                  </li>
                  <li>
                    <a href="#38a975b802" class="toc-h2 toc-link" data-title="深度信息">深度信息</a>
                  </li>
                  <li>
                    <a href="#404aacd9b3" class="toc-h2 toc-link" data-title="近期成交">近期成交</a>
                  </li>
                  <li>
                    <a href="#market_data" class="toc-h2 toc-link" data-title="查询历史成交(MARKET_DATA)">查询历史成交(MARKET_DATA)</a>
                  </li>
                  <li>
                    <a href="#c59e471e81" class="toc-h2 toc-link" data-title="近期成交(归集)">近期成交(归集)</a>
                  </li>
                  <li>
                    <a href="#k" class="toc-h2 toc-link" data-title="K线数据">K线数据</a>
                  </li>
                  <li>
                    <a href="#k-2" class="toc-h2 toc-link" data-title="连续合约K线数据">连续合约K线数据</a>
                  </li>
                  <li>
                    <a href="#k-3" class="toc-h2 toc-link" data-title="价格指数K线数据">价格指数K线数据</a>
                  </li>
                  <li>
                    <a href="#k-4" class="toc-h2 toc-link" data-title="标记价格K线数据">标记价格K线数据</a>
                  </li>
                  <li>
                    <a href="#69f9b0b2f3" class="toc-h2 toc-link" data-title="最新标记价格和资金费率">最新标记价格和资金费率</a>
                  </li>
                  <li>
                    <a href="#31dbeb24c4" class="toc-h2 toc-link" data-title="查询资金费率历史">查询资金费率历史</a>
                  </li>
                  <li>
                    <a href="#24hr" class="toc-h2 toc-link" data-title="24hr价格变动情况">24hr价格变动情况</a>
                  </li>
                  <li>
                    <a href="#8ff46b58de" class="toc-h2 toc-link" data-title="最新价格">最新价格</a>
                  </li>
                  <li>
                    <a href="#5393cd07b4" class="toc-h2 toc-link" data-title="当前最优挂单">当前最优挂单</a>
                  </li>
                  <li>
                    <a href="#f6cc22e496" class="toc-h2 toc-link" data-title="获取未平仓合约数">获取未平仓合约数</a>
                  </li>
                  <li>
                    <a href="#c1c9193984" class="toc-h2 toc-link" data-title="合约持仓量">合约持仓量</a>
                  </li>
                  <li>
                    <a href="#4d050dd845" class="toc-h2 toc-link" data-title="大户账户数多空比">大户账户数多空比</a>
                  </li>
                  <li>
                    <a href="#269e531011" class="toc-h2 toc-link" data-title="大户持仓量多空比">大户持仓量多空比</a>
                  </li>
                  <li>
                    <a href="#4d55ab5a20" class="toc-h2 toc-link" data-title="多空持仓人数比">多空持仓人数比</a>
                  </li>
                  <li>
                    <a href="#249be3ac39" class="toc-h2 toc-link" data-title="合约主动买卖量">合约主动买卖量</a>
                  </li>
                  <li>
                    <a href="#k-5" class="toc-h2 toc-link" data-title="杠杆代币历史净值K线">杠杆代币历史净值K线</a>
                  </li>
                  <li>
                    <a href="#669b9d47c2" class="toc-h2 toc-link active" data-title="综合指数交易对信息">综合指数交易对信息</a>
                  </li>
              </ul>
          </li>
          <li>
            <a href="#websocket" class="toc-h1 toc-link" data-title="Websocket 行情推送">Websocket 行情推送</a>
              <ul class="toc-list-h2" style="display: none;">
                  <li>
                    <a href="#3c863d56da" class="toc-h2 toc-link" data-title="实时订阅/取消数据流">实时订阅/取消数据流</a>
                  </li>
                  <li>
                    <a href="#b14c7e3649" class="toc-h2 toc-link" data-title="最新合约价格">最新合约价格</a>
                  </li>
                  <li>
                    <a href="#1e66c0284e" class="toc-h2 toc-link" data-title="归集交易">归集交易</a>
                  </li>
                  <li>
                    <a href="#2feac0b7e2" class="toc-h2 toc-link" data-title="最新标记价格">最新标记价格</a>
                  </li>
                  <li>
                    <a href="#7be41192f9" class="toc-h2 toc-link" data-title="全市场最新标记价格">全市场最新标记价格</a>
                  </li>
                  <li>
                    <a href="#k-6" class="toc-h2 toc-link" data-title="K线">K线</a>
                  </li>
                  <li>
                    <a href="#k-7" class="toc-h2 toc-link" data-title="连续合约K线">连续合约K线</a>
                  </li>
                  <li>
                    <a href="#symbol-ticker" class="toc-h2 toc-link" data-title="按Symbol的精简Ticker">按Symbol的精简Ticker</a>
                  </li>
                  <li>
                    <a href="#ticker" class="toc-h2 toc-link" data-title="全市场的精简Ticker">全市场的精简Ticker</a>
                  </li>
                  <li>
                    <a href="#symbol-ticker-2" class="toc-h2 toc-link" data-title="按Symbol的完整Ticker">按Symbol的完整Ticker</a>
                  </li>
                  <li>
                    <a href="#ticker-2" class="toc-h2 toc-link" data-title="全市场的完整Ticker">全市场的完整Ticker</a>
                  </li>
                  <li>
                    <a href="#symbol" class="toc-h2 toc-link" data-title="按Symbol的最优挂单信息">按Symbol的最优挂单信息</a>
                  </li>
                  <li>
                    <a href="#3a40b1071b" class="toc-h2 toc-link" data-title="全市场最优挂单信息">全市场最优挂单信息</a>
                  </li>
                  <li>
                    <a href="#2f03186fe7" class="toc-h2 toc-link" data-title="强平订单">强平订单</a>
                  </li>
                  <li>
                    <a href="#b1d3fbf198" class="toc-h2 toc-link" data-title="全市场强平订单">全市场强平订单</a>
                  </li>
                  <li>
                    <a href="#6ae7c2b506" class="toc-h2 toc-link" data-title="有限档深度信息">有限档深度信息</a>
                  </li>
                  <li>
                    <a href="#1654ad2dd2" class="toc-h2 toc-link" data-title="增量深度信息">增量深度信息</a>
                  </li>
                  <li>
                    <a href="#orderbook" class="toc-h2 toc-link" data-title="如何正确在本地维护一个orderbook副本">如何正确在本地维护一个orderbook副本</a>
                  </li>
                  <li>
                    <a href="#3b7da71d4b" class="toc-h2 toc-link" data-title="杠杆代币信息更新">杠杆代币信息更新</a>
                  </li>
                  <li>
                    <a href="#k-8" class="toc-h2 toc-link" data-title="杠杆代币净值K线">杠杆代币净值K线</a>
                  </li>
                  <li>
                    <a href="#f55afdefd4" class="toc-h2 toc-link" data-title="综合指数交易对信息流">综合指数交易对信息流</a>
                  </li>
              </ul>
          </li>
          <li>
            <a href="#93d49cc2e5" class="toc-h1 toc-link" data-title="账户和交易接口">账户和交易接口</a>
              <ul class="toc-list-h2">
                  <li>
                    <a href="#1045de04a1" class="toc-h2 toc-link" data-title="划转">划转</a>
                  </li>
                  <li>
                    <a href="#87a7130ac5" class="toc-h2 toc-link" data-title="获取划转历史">获取划转历史</a>
                  </li>
                  <li>
                    <a href="#trade" class="toc-h2 toc-link" data-title="更改持仓模式(TRADE)">更改持仓模式(TRADE)</a>
                  </li>
                  <li>
                    <a href="#user_data" class="toc-h2 toc-link" data-title="查询持仓模式(USER_DATA)">查询持仓模式(USER_DATA)</a>
                  </li>
                  <li>
                    <a href="#trade-2" class="toc-h2 toc-link" data-title="更改联合保证金模式(TRADE)">更改联合保证金模式(TRADE)</a>
                  </li>
                  <li>
                    <a href="#user_data-2" class="toc-h2 toc-link" data-title="查询联合保证金模式(USER_DATA)">查询联合保证金模式(USER_DATA)</a>
                  </li>
                  <li>
                    <a href="#trade-3" class="toc-h2 toc-link" data-title="下单 (TRADE)">下单 (TRADE)</a>
                  </li>
                  <li>
                    <a href="#trade-4" class="toc-h2 toc-link" data-title="测试下单接口 (TRADE)">测试下单接口 (TRADE)</a>
                  </li>
                  <li>
                    <a href="#trade-5" class="toc-h2 toc-link" data-title="批量下单 (TRADE)">批量下单 (TRADE)</a>
                  </li>
                  <li>
                    <a href="#user_data-3" class="toc-h2 toc-link" data-title="查询订单 (USER_DATA)">查询订单 (USER_DATA)</a>
                  </li>
                  <li>
                    <a href="#trade-6" class="toc-h2 toc-link" data-title="撤销订单 (TRADE)">撤销订单 (TRADE)</a>
                  </li>
                  <li>
                    <a href="#trade-7" class="toc-h2 toc-link" data-title="撤销全部订单 (TRADE)">撤销全部订单 (TRADE)</a>
                  </li>
                  <li>
                    <a href="#trade-8" class="toc-h2 toc-link" data-title="批量撤销订单 (TRADE)">批量撤销订单 (TRADE)</a>
                  </li>
                  <li>
                    <a href="#trade-9" class="toc-h2 toc-link" data-title="倒计时撤销所有订单 (TRADE)">倒计时撤销所有订单 (TRADE)</a>
                  </li>
                  <li>
                    <a href="#user_data-4" class="toc-h2 toc-link" data-title="查询当前挂单 (USER_DATA)">查询当前挂单 (USER_DATA)</a>
                  </li>
                  <li>
                    <a href="#user_data-5" class="toc-h2 toc-link" data-title="查看当前全部挂单 (USER_DATA)">查看当前全部挂单 (USER_DATA)</a>
                  </li>
                  <li>
                    <a href="#user_data-6" class="toc-h2 toc-link" data-title="查询所有订单(包括历史订单) (USER_DATA)">查询所有订单(包括历史订单) (USER_DATA)</a>
                  </li>
                  <li>
                    <a href="#v2-user_data" class="toc-h2 toc-link" data-title="账户余额V2 (USER_DATA)">账户余额V2 (USER_DATA)</a>
                  </li>
                  <li>
                    <a href="#v2-user_data-2" class="toc-h2 toc-link" data-title="账户信息V2 (USER_DATA)">账户信息V2 (USER_DATA)</a>
                  </li>
                  <li>
                    <a href="#trade-10" class="toc-h2 toc-link" data-title="调整开仓杠杆 (TRADE)">调整开仓杠杆 (TRADE)</a>
                  </li>
                  <li>
                    <a href="#trade-11" class="toc-h2 toc-link" data-title="变换逐全仓模式 (TRADE)">变换逐全仓模式 (TRADE)</a>
                  </li>
                  <li>
                    <a href="#trade-12" class="toc-h2 toc-link" data-title="调整逐仓保证金 (TRADE)">调整逐仓保证金 (TRADE)</a>
                  </li>
                  <li>
                    <a href="#trade-13" class="toc-h2 toc-link" data-title="逐仓保证金变动历史 (TRADE)">逐仓保证金变动历史 (TRADE)</a>
                  </li>
                  <li>
                    <a href="#v2-user_data-3" class="toc-h2 toc-link" data-title="用户持仓风险V2 (USER_DATA)">用户持仓风险V2 (USER_DATA)</a>
                  </li>
                  <li>
                    <a href="#user_data-7" class="toc-h2 toc-link" data-title="账户成交历史 (USER_DATA)">账户成交历史 (USER_DATA)</a>
                  </li>
                  <li>
                    <a href="#user_data-8" class="toc-h2 toc-link" data-title="获取账户损益资金流水(USER_DATA)">获取账户损益资金流水(USER_DATA)</a>
                  </li>
                  <li>
                    <a href="#user_data-9" class="toc-h2 toc-link" data-title="杠杆分层标准 (USER_DATA)">杠杆分层标准 (USER_DATA)</a>
                  </li>
                  <li>
                    <a href="#adl-user_data" class="toc-h2 toc-link" data-title="持仓ADL队列估算 (USER_DATA)">持仓ADL队列估算 (USER_DATA)</a>
                  </li>
                  <li>
                    <a href="#user_data-10" class="toc-h2 toc-link" data-title="用户强平单历史 (USER_DATA)">用户强平单历史 (USER_DATA)</a>
                  </li>
                  <li>
                    <a href="#api-user_data" class="toc-h2 toc-link" data-title="用户 API 交易量化规则指标 (USER_DATA)">用户 API 交易量化规则指标 (USER_DATA)</a>
                  </li>
                  <li>
                    <a href="#user_data-11" class="toc-h2 toc-link" data-title="用户手续费率 (USER_DATA)">用户手续费率 (USER_DATA)</a>
                  </li>
              </ul>
          </li>
          <li>
            <a href="#websocket-2" class="toc-h1 toc-link" data-title="Websocket 账户信息推送">Websocket 账户信息推送</a>
              <ul class="toc-list-h2">
                  <li>
                    <a href="#listenkey-user_stream" class="toc-h2 toc-link" data-title="生成listenKey (USER_STREAM)">生成listenKey (USER_STREAM)</a>
                  </li>
                  <li>
                    <a href="#listenkey-user_stream-2" class="toc-h2 toc-link" data-title="延长listenKey有效期 (USER_STREAM)">延长listenKey有效期 (USER_STREAM)</a>
                  </li>
                  <li>
                    <a href="#listenkey-user_stream-3" class="toc-h2 toc-link" data-title="关闭listenKey (USER_STREAM)">关闭listenKey (USER_STREAM)</a>
                  </li>
                  <li>
                    <a href="#listenkey" class="toc-h2 toc-link" data-title="listenKey 过期推送">listenKey 过期推送</a>
                  </li>
                  <li>
                    <a href="#145a4121d8" class="toc-h2 toc-link" data-title="追加保证金通知">追加保证金通知</a>
                  </li>
                  <li>
                    <a href="#balance-position" class="toc-h2 toc-link" data-title="Balance和Position更新推送">Balance和Position更新推送</a>
                  </li>
                  <li>
                    <a href="#060a012f0b" class="toc-h2 toc-link" data-title="订单/交易 更新推送">订单/交易 更新推送</a>
                  </li>
                  <li>
                    <a href="#c7d7476989" class="toc-h2 toc-link" data-title="杠杆倍数等账户配置 更新推送">杠杆倍数等账户配置 更新推送</a>
                  </li>
              </ul>
          </li>
          <li>
            <a href="#cf68bca02a" class="toc-h1 toc-link" data-title="错误代码">错误代码</a>
              <ul class="toc-list-h2">
                  <li>
                    <a href="#10xx" class="toc-h2 toc-link" data-title="10xx - 常规服务器或网络问题">10xx - 常规服务器或网络问题</a>
                  </li>
                  <li>
                    <a href="#11xx-request-issues" class="toc-h2 toc-link" data-title="11xx - Request issues">11xx - Request issues</a>
                  </li>
                  <li>
                    <a href="#20xx-processing-issues" class="toc-h2 toc-link" data-title="20xx - Processing Issues">20xx - Processing Issues</a>
                  </li>
                  <li>
                    <a href="#40xx-filters-and-other-issues" class="toc-h2 toc-link" data-title="40xx - Filters and other Issues">40xx - Filters and other Issues</a>
                  </li>
              </ul>
          </li>
      </ul>
        <ul class="toc-footer">
            <li><a href="https://www.binance.com/cn/futures/">Binance Futures</a></li>
        </ul>
    </div>
    <div class="page-wrapper">
      <div class="dark-box"></div>
      <div class="content">
        <h1 id="185368440e">更新日志</h1>
<p><font size="4"><strong>2021-05-06</strong></font></p>

<p>WEBSOCKET</p>

<ul>
<li>更新以下接口：

<ul>
<li>原有杠杆倍数更新推送事件<code>ACCOUNT_CONFIG_UPDATE</code>扩展为账户配置更新推送事件，包含杠杆倍数与联合保证金状态更新推送</li>
<li>Balance和Position更新推送<code>ACCOUNT_UPDATE</code>的事件<code>m</code>枚举类型新增<code>AUTO_EXCHANGE</code>代表联合保证金自动兑换事件</li>
</ul></li>
</ul>

<p>REST</p>

<ul>
<li><p>新增以下接口:</p>

<ul>
<li><code>POST /fapi/v1/multiAssetsMargin</code> 以更改联合保证金模式</li>
<li><code>GET /fapi/v1/multiAssetsMargin</code> 以查询联合保证金模式</li>
</ul></li>
<li><p>更新以下接口:</p>

<ul>
<li><code>GET /fapi/v1/exchangeInfo</code> 响应加入<code>assets</code>资产信息</li>
<li><code>GET /fapi/v2/balance</code>与<code>GET /fapi/v2/account</code> 响应加入<code>marginAvailable</code>字段代表是否可用作联合保证金</li>
</ul></li>
</ul>

<hr>

<p><font size="4"><strong>2021-04-27</strong></font></p>

<p>WEBSOCKET</p>

<ul>
<li>以下市场强平订单推送事件由实时推送调整为快照推送，即每秒最多推送一条强平订单数据:

<ul>
<li><code>&lt;symbol&gt;@forceOrder</code></li>
<li><code>!forceOrder@arr</code></li>
</ul></li>
</ul>

<p>REST</p>

<ul>
<li>获取市场强平订单接口 <code>GET /fapi/v1/allForceOrders</code>停止维护，不再接受请求 </li>
</ul>

<hr>

<p><font size="4"><strong>2021-04-22</strong></font></p>

<p>WEBSOCKET</p>

<ul>
<li>"ACCOUNT_UPDATE" 事件新增返回字段 "bc" 表示账户余额改变量。</li>
</ul>

<hr>

<p><font size="4"><strong>2021-03-02</strong></font></p>

<ul>
<li><p>新增接口 <code>GET /fapi/v1/indexPriceKlines</code> 以获取价格指数K线数据。</p></li>
<li><p>新增接口 <code>GET /fapi/v1/markPriceKlines</code> 以获取标记价格K线数据。</p></li>
</ul>

<hr>

<p><font size="4"><strong>2021-02-24</strong></font></p>

<p>REST RATE LIMIT WEIGHT</p>

<ul>
<li>接口 <code>GET /fapi/v2/balance</code> 的请求权重更新为 5</li>
<li>接口 <code>GET /fapi/v2/positionRisk</code> 的请求权重更新为 5</li>
</ul>

<hr>

<p><font size="4"><strong>2021-02-22</strong></font></p>

<p>REST RATE LIMIT WEIGHT</p>

<ul>
<li>接口 <code>GET /fapi/v1/income</code> 的请求权重更新为 30</li>
</ul>

<p>REST</p>

<ul>
<li>接口<code>GET /fapi/v1/allOrders</code> 的查询时间范围最大为7天.</li>
<li>接口<code>GET /fapi/v1/allForceOrders</code>的查询范围仅限于最近7天内的数据.</li>
</ul>

<hr>

<p><font size="4"><strong>2021-01-26</strong></font></p>

<p>WEB SOCKET USER DATA STREAM</p>

<ul>
<li>USER-DATA-STREAM 中新增事件<code>ACCOUNT_CONFIG_UPDATE</code>以获取交易对杠杆倍数变动更新</li>
</ul>

<p>REST RATE LIMIT WEIGHT</p>

<ul>
<li>以下接口的权重调整为 带symbol 20, 不带symbol 50

<ul>
<li><code>GET /fapi/v1/allForceOrders</code></li>
<li><code>GET /fapi/v1/forceOrders</code></li>
</ul></li>
</ul>

<p>REST</p>

<ul>
<li>新增交易对过滤器 "MIN_NOTIONAL"，定义了交易对订单所允许的最小名义价值，并在 <code>fapi/v1/exchangeInfo</code> 的响应中返回</li>
</ul>

<hr>

<p><font size="4"><strong>2021-01-21</strong></font></p>

<p>合约订单用户自定义id<code>newClientOrderId</code>更新正则规则为: <code>^[\.A-Z\:/a-z0-9_-]{1,36}$</code></p>

<hr>

<p><font size="4"><strong>2021-01-04</strong></font></p>

<p>REST</p>

<ul>
<li><p>以下接口的IP限制权重将采用基于参数LIMIT数值的新权重规则:</p>

<ul>
<li><code>GET /fapi/v1/klines</code></li>
<li><code>GET /fapi/v1/continuousKlines</code></li>
</ul></li>
<li><p>以下接口的IP限制权重调整到 20:</p>

<ul>
<li><code>GET /fapi/v1/historicalTrades</code></li>
<li><code>GET /fapi/v1/allForceOrders</code></li>
<li><code>GET /fapi/v1/forceOrders</code></li>
<li><code>GET /fapi/v1/aggTrades</code></li>
</ul></li>
</ul>

<hr>

<p><font size="4"><strong>2020-12-08</strong></font></p>

<p>WEBSOCKET</p>

<ul>
<li>行情消息推送 <code>&lt;symbol&gt;@bookTicker</code> 和 <code>!bookTicker</code> 返回内容新增字段<code>e</code> 表示事件类型</li>
<li>行情消息推送<code>&lt;symbol&gt;@markPrice</code>, <code>&lt;symbol&gt;@markPrice@1s</code>, <code>!markPrice@arr</code>, 和 <code>!markPrice@arr@1s</code> 返回内容新增字段<code>P</code> 表示估计结算价</li>
<li>新增行情连续合约K线推送 <code>&lt;pair&gt;_&lt;contractType&gt;@continuousKline_&lt;interval&gt;</code> </li>
</ul>

<p>REST API</p>

<ul>
<li>接口 <code>GET /fapi/v1/premiumIndex</code> 返回内容新增字段 "estimatedSettlePrice" 表示估计结算价。</li>
<li><p>接口<code>GET /fapi/v1/exchangeInfo</code> 返回内容新增字段:</p>

<ul>
<li>"pair" 标的交易对</li>
<li>"contractType" 合约类型</li>
<li>"deliveryDate" 交割日期</li>
<li>"onboardDate" 上线日期</li>
</ul></li>
<li><p>新增接口 <code>GET /fapi/v1/continuousKlines</code> 获取连续合约K线数据</p></li>
</ul>

<p>ENUM</p>

<ul>
<li>合约类型:

<ul>
<li>PERPETUAL 永续合约 </li>
<li>CURRENT_MONTH 当月交割合约</li>
<li>NEXT_MONTH 次月交割合约</li>
<li>CURRENT_QUARTER 当季交割合约</li>
<li>NEXT_QUARTER 次季交割合约 </li>
</ul></li>
</ul>

<hr>

<p><font size="4"><strong>2020-11-27</strong></font></p>

<ul>
<li>新增接口 <code>GET /fapi/v1/commissionRate</code> 以查询用户交易手续费率。</li>
</ul>

<hr>

<p><font size="4"><strong>2020-11-13</strong></font></p>

<p>WEB SOCKET STREAM</p>

<ul>
<li>为了给用户提供更安全稳定的服务，<code>&lt;symbol&gt;depth@0ms</code> and <code>&lt;symbol&gt;@depth&lt;level&gt;@0ms</code> 的更新频率调整为根据数据流量总量和其他客观情况动态调整</li>
</ul>

<hr>

<p><font size="4"><strong>2020-11-10</strong></font></p>

<ul>
<li>接口<code>GET /fapi/v1/exchangeInfo</code> 新增返回字段 "marginAsset" 表示保证金资产</li>
<li>接口<code>GET /fapi/v2/account</code>新增返回字段 "positionAmt" 表示持仓数量</li>
</ul>

<hr>

<p><font size="4"><strong>2020-11-09</strong></font></p>

<p>WEB SOCKET USER DATA STREAM</p>

<p>USER-DATA-STREAM 中的事件<code>ACCOUNT_UPDATE</code>推送规则作出了以下更新和优化：</p>

<ul>
<li><p>当用户某项资产发生变化时：</p>

<ul>
<li>资产项目"B"中仅会推送本次发生变化的资产及其余额</li>
<li>其他资产不会被推送，即便资产不为0</li>
<li>如果资产变化不涉及持仓变化，持仓项目"P"将仅返回空<code>[]</code></li>
</ul></li>
<li><p>当合约某symbol的持仓或全逐仓配置发生变动时</p>

<ul>
<li>"P"中会推送该symbol对应的"BOTH"方向上的持仓详情</li>
<li>如果是多空方向上发生持仓变动, "P"中会推送该symbol发生持仓变动的对应"LONG"或"SHORT"方向上的持仓详情</li>
<li>该symbol上被初始化过的"LONG"或"SHORT"方向的逐仓持仓, 也会被推送</li>
<li>所以该symbol上推送的position方向组合, 由具体场景决定()</li>
<li>其他symbol的所有持仓信息都不会被推送，即使其持仓不为0</li>
</ul></li>
<li><p>简言之, 您应该通过相关的rest接口( <code>GET /fapi/v2/account</code> 和 <code>GET /fapi/v2/positionRisk</code>) 获取资产和头寸的<strong>全量</strong>信息; 通过Websocket USER-DATA-STREAM 中的事件<code>ACCOUNT_UPDATE</code>对本地缓存的资产或头寸数据进行<strong>增量</strong>更新。</p></li>
<li><p>可以访问<a href="https://dev.binance.vision/t/838">这里</a> 获取示例以帮助对本次优化升级的理解</p></li>
</ul>

<hr>

<p><font size="4"><strong>2020-10-27</strong></font></p>

<p>WEB SOCKET STREAM</p>

<ul>
<li>单个连接可订阅的最大stream数量调整为 200</li>
</ul>

<hr>

<p><font size="4"><strong>2020-10-10</strong></font></p>

<p>WEBSOCKET</p>

<ul>
<li>新增 WebSocket 综合指数交易对信息更新<code>&lt;symbol&gt;@compositeIndex</code> 。</li>
</ul>

<hr>

<p><font size="4"><strong>2020-10-09</strong></font></p>

<ul>
<li>新增接口 <code>GET /fapi/v1/indexInfo</code> 以获取交易对为综合指数的基础成分信息。</li>
</ul>

<hr>

<p><font size="4"><strong>2020-09-18</strong></font></p>

<ul>
<li> 新增 API 交易量化规则指标查询接口 <code>GET /fapi/v1/apiTradingStatus</code>。</li>
</ul>

<hr>

<p><font size="4"><strong>2020-09-16</strong></font></p>

<ul>
<li> 新增杠杆代币历史净值K线接口 <code>GET /fapi/v1/lvtKlines</code>。<br>
杠杆代币净值系统基于合约架构，故该接口采用fapi。</li>
</ul>

<p>WEBSOCKET</p>

<ul>
<li>新增 WebSocket 杠杆代币信息更新<code>&lt;tokenName&gt;@tokenNav</code> 和<br>
净值K线更新<code>&lt;tokenName&gt;@nav_Kline_&lt;interval&gt;</code>。<br>
杠杆代币净值系统基于合约架构，故该推送采用合约WS服务。</li>
</ul>

<hr>

<p><font size="4"><strong>2020-09-09</strong></font></p>

<ul>
<li>一些过期或者被取消的订单将在未来开始逐步不会从API的接口返回。

<ul>
<li>被移除的订单需要满足如下条件: 

<ul>
<li>订单的最终状态为 <code>CANCELED</code> 或者 <code>EXPIRED</code>, <strong>并且</strong> </li>
<li>订单没有任何的成交记录, <strong>并且</strong></li>
<li>订单生成时间 + 7天 &lt; 当前时间</li>
</ul></li>
<li>如下的接口会受影响:

<ul>
<li><code>GET /fapi/v1/order</code></li>
<li><code>GET /fapi/v1/allOrders</code></li>
</ul></li>
</ul></li>
</ul>

<hr>

<p><font size="4"><strong>2020-08-14</strong></font></p>

<ul>
<li>接口<code>GET /fapi/v1/premiumIndex</code> 新增返回字段 "indexPrice", 表示现货指数价格。</li>
<li>以下websocket 行情，新增返回字段 "i" 表示现货指数价格： 

<ul>
<li><code>&lt;symbol&gt;@markPrice</code>, </li>
<li><code>&lt;symbol&gt;@markPrice@1s</code>, </li>
<li><code>!markPrice@arr</code>,</li>
<li><code>!markPrice@arr@1s</code> </li>
</ul></li>
</ul>

<hr>

<p><font size="4"><strong>2020-08-12</strong></font></p>

<ul>
<li>新增接口 <code>GET /fapi/v1/forceOrders</code> 以获取用户强平订单历史.</li>
</ul>

<hr>

<p><font size="4"><strong>2020-07-30</strong></font></p>

<ul>
<li>新增接口<code>GET /fapi/v1/adlQuantile</code> 以获取持仓ADL队列位置估算分数</li>
</ul>

<hr>

<p><font size="4"><strong>2020-07-17</strong></font></p>

<ul>
<li>接口 <code>GET /fapi/v1/income</code> 权重调整为 20</li>
</ul>

<hr>

<p><font size="4"><strong>2020-07-02</strong></font></p>

<p>WEBSOCKET</p>

<ul>
<li>"ACCOUNT_UPDATE" 事件新增返回字段 "m" 表示事件推出缘由。</li>
<li>"ORDER_TRADE_UPDATE" 事件新增返回字段 "rp" 表示该交易实现损益。</li>
</ul>

<hr>

<p><font size="4"><strong>2020-06-15</strong></font></p>

<ul>
<li>接口<code>GET /fapi/v2/account</code>，<code>GET /fapi/v2/balance</code>返回内容新增字段:

<ul>
<li><code>availableBalance</code></li>
<li><code>maxWithdrawAmount</code></li>
</ul></li>
</ul>

<hr>

<p><font size="4"><strong>2020-06-04</strong></font></p>

<ul>
<li>新增 <code>/fapi/v2/</code> 接口, 较v1对应接口性能有较大提升: 

<ul>
<li><code>GET /fapi/v2/account</code></li>
<li><code>GET /fapi/v2/balance</code></li>
</ul></li>
</ul>

<hr>

<p><font size="4"><strong>2020-06-02</strong></font></p>

<ul>
<li>新增 <code>/fapi/v2/</code> 接口 <code>GET /fapi/v2/positionRisk</code>:

<ul>
<li>允许用户指定symbol查询</li>
<li>市场上所有symbol都可以被查询</li>
<li>返回内容有效区分单向持仓模式和双向持仓模式</li>
<li>较 ‘/fapi/v1/positionRisk’ 性能有较大改善</li>
</ul></li>
</ul>

<hr>

<p><font size="4"><strong>2020-05-18</strong></font></p>

<ul>
<li><p>新增参数 <code>closePosition</code> 于下单接口  <code>POST /fapi/v1/order</code>, 表示条件全部平仓:<br>
如果一个<code>STOP_MARKET</code> 或 <code>TAKE_PROFIT_MARKET</code> 条简单设置了 <code>closePosition=true</code> 并被触发了，当时持有<strong>所有</strong>多头仓位(若为卖单)或当时持有<strong>所有</strong>空头仓位(若为买单)将会被平仓。</p></li>
<li><p>新增返回字段<code>closePosition</code>于以下接口表示是否为条件全平仓单:</p>

<ul>
<li><code>POST /fapi/v1/order</code></li>
<li><code>POST /fapi/v1/batchOrders</code></li>
<li><code>GET /fapi/v1/order</code></li>
<li><code>DELETE /fapi/v1/order</code></li>
<li><code>DELETE /fapi/v1/batchOrders</code></li>
<li><code>GET /fapi/v1/openOrder</code></li>
<li><code>GET /fapi/v1/openOrders</code></li>
<li><code>GET /fapi/v1/allOrders</code></li>
</ul></li>
</ul>

<hr>

<p><font size="4"><strong>2020-05-18</strong></font></p>

<ul>
<li>一些过期或者被取消的订单将在未来开始逐步不会从API的接口返回, 但是还可以从网页端查询到。

<ul>
<li>被移除的订单需要满足如下条件: 

<ul>
<li>订单的最终状态为 <code>CANCELED</code> 或者 <code>EXPIRED</code>, <strong>并且</strong> </li>
<li>订单没有任何的成交记录, <strong>并且</strong></li>
<li>订单生成时间 + 30天 &lt; 当前时间</li>
</ul></li>
<li>如下的接口会受影响:

<ul>
<li><code>GET /fapi/v1/order</code></li>
<li><code>GET /fapi/v1/allOrders</code></li>
</ul></li>
</ul></li>
</ul>

<hr>

<p><font size="4"><strong>2020-05-15</strong></font></p>

<ul>
<li>Wesocket 行情消息 <code>&lt;symbol&gt;@bookTicker</code> 和 <code>!bookTicker</code> 增加返回字段:

<ul>
<li><code>E</code> 表示事件推出事件</li>
<li><code>T</code> 表示撮合时间</li>
</ul></li>
</ul>

<hr>

<p><font size="4"><strong>2020-05-14</strong></font></p>

<ul>
<li>以下接口返回内容增加<code>time</code>字段，表示撮合引擎时间：

<ul>
<li><code>GET /fapi/v1/ticker/price</code></li>
<li><code>GET /fapi/v1/ticker/bookTicker</code></li>
<li><code>GET /fapi/v1/openInterest</code><br></li>
</ul></li>
</ul>

<hr>

<p><font size="4"><strong>2020-05-11</strong></font></p>

<ul>
<li>新增接口 <code>POST /fapi/v1/s/countdownCancelAll</code> 以实现倒计时自动撤单。<br>

<ul>
<li>该接口可以被用于确保在倒计时结束时撤销指定symbol上的所有挂单。 </li>
<li>在使用这个功能时，接口应像心跳一样在倒计时内被反复调用，以便可以取消既有的倒计时并开始新的倒数计时设置。</li>
</ul></li>
</ul>

<hr>

<p><font size="4"><strong>2020-05-06</strong></font></p>

<p>REST 接口</p>

<ul>
<li>接口 <code>GET /fapi/v1/leverageBracket</code> 调整为 USER-DATA 权限访问，需要验签以及timestamp</li>
</ul>

<p>WEBSOCKET 账户信息推送</p>

<ul>
<li>请注意: 当某一持仓发生"FUNDING FEE"时，事件<code>ACCOUNT_UPDATE</code>将只会推送相关的用户资产余额信息和持仓信息，而不会推送其余无关的资产和持仓信息。 

<ul>
<li>当用户某<strong>全仓</strong>持仓发生"FUNDING FEE"时，事件<code>ACCOUNT_UPDATE</code>将只会推送相关的用户资产余额信息<code>B</code>(仅推送FUNDING FEE 发生相关的资产余额信息)，而不会推送任何持仓信息<code>P</code>。</li>
<li>当用户某<strong>逐仓</strong>仓持仓发生"FUNGDING FEE"时，事件<code>ACCOUNT_UPDATE</code>将只会推送相关的用户资产余额信息<code>B</code>(仅推送"FUNDING FEE"所使用的资产余额信息)，和相关的持仓信息<code>P</code>(仅推送这笔"FUNDING FEE"发生所在的持仓信息)，其余持仓信息不会被推送</li>
</ul></li>
</ul>

<hr>

<p><font size="4"><strong>2020-04-25</strong></font></p>

<ul>
<li><p>用户"订单/交易更新推送" <code>ORDER_TRADE_UPDATE</code> 新增以下字段:</p>

<ul>
<li><code>cp</code> 表示是否为平仓条件单</li>
<li><code>AP</code> 表示追踪止损单的追踪止损激活价格</li>
<li><code>cr</code> 表示追踪止损单的追踪止损回调比例</li>
</ul></li>
<li><p>新增账户信息推送事件: "追加保证金通知"<code>MARGIN_CALL</code>.</p></li>
</ul>

<hr>

<p><font size="4"><strong>2020-04-17</strong></font></p>

<ul>
<li>下单接口支持新的可选参数 <code>newOrderRespType</code> 表示下单响应类型。支持<code>ACK</code> 和 <code>RESULT</code>,<br>
如果<code>newOrderRespType= RESULT</code>:

<ul>
<li><code>MARKET</code> 订单将直接返回成交(FILLED)结果；</li>
<li>配合使用特殊 <code>timeInForce</code> 的 <code>LIMIT</code> 订单将直接返回成交/过期(FILLED/EXPIRED)结果。</li>
</ul></li>
</ul>

<hr>

<p><font size="4"><strong>2020-04-14</strong></font></p>

<p>WEB SOCKET 连接限制</p>

<ul>
<li>Websocket服务器每秒最多接受5个消息。消息包括:

<ul>
<li>PING帧</li>
<li>PONG帧</li>
<li>JSON格式的消息, 比如订阅, 断开订阅.</li>
</ul></li>
<li>如果用户发送的消息超过限制，连接会被断开连接。反复被断开连接的IP有可能被服务器屏蔽。</li>
<li>单个连接最多可以订阅 <strong>1024</strong> 个Streams。</li>
</ul>

<hr>

<p><font size="4"><strong>2020-04-09</strong></font></p>

<ul>
<li>新增接口合约大数据 <code>GET /futures/data/takerlongshortRatio</code> 以查询合约主动买卖量</li>
</ul>

<hr>

<p><font size="4"><strong>2020-04-08</strong></font></p>

<ul>
<li>新增接口 <code>GET /fapi/v1/positionSide/dual</code> 以查询用户当前持仓模式</li>
<li>新增接口 <code>POST /fapi/v1/batchOrders</code> 以实现批量下单</li>
</ul>

<hr>

<p><font size="4"><strong>2020-04-06</strong></font></p>

<ul>
<li><p>请注意 账户信息推送 事件 "Balance和Position更新推送"(<code>ACCOUNT_UPDATE</code>)将不再未发生更新时推送，具体规则如下：</p>

<ul>
<li>仅当账户信息有变动时(包括资金、仓位、保证金模式等发生变化)，才会推送此事件；</li>
<li>订单状态变化没有引起账户和持仓变化的，不会推送此事件；</li>
<li>每次推送的position 信息，仅包含当前持仓不为0或逐仓仓位保证金不为0的symbol position。</li>
</ul></li>
<li><p>新增接口 <code>POST /fapi/v1/positionSide/dual</code> 更改持仓模式：双向或单向持仓模式。</p></li>
<li><p>以下接口新增参数 <code>positionSide</code> 用以支持单向/双向持仓模式，表示持仓方向：</p>

<ul>
<li><code>POST /fapi/v1/order</code></li>
<li><code>POST /fapi/v1/positionMargin</code></li>
</ul></li>
<li><p>以下接口新增返回字段 <code>positionSide</code> 用以支持单向/双向持仓模式，表示持仓方向：</p>

<ul>
<li><code>POST /fapi/v1/order</code></li>
<li><code>GET /fapi/v1/order</code></li>
<li><code>DELETE /fapi/v1/order</code></li>
<li><code>DELETE /fapi/v1/batchOrders</code></li>
<li><code>GET /fapi/v1/openOrder</code></li>
<li><code>GET /fapi/v1/openOrders</code></li>
<li><code>GET /fapi/v1/allOrders</code></li>
<li><code>GET /fapi/v1/account</code></li>
<li><code>POST /fapi/v1/positionMargin</code></li>
<li><code>GET /fapi/v1/positionMargin/history</code></li>
<li><code>GET /fapi/v1/positionRisk</code></li>
<li><code>GET /fapi/v1/userTrades</code></li>
</ul></li>
<li><p>账户信息推送 事件 "Balance和Position更新推送"(<code>ACCOUNT_UPDATE</code>)和 "订单/交易更新推送"(ORDER_TRADE_UPDATE)中新增字段 <code>ps</code> 表示持仓方向。</p></li>
</ul>

<hr>

<p><font size="4"><strong>2020-03-30</strong></font></p>

<ul>
<li>新增接口合约大数据: 

<ul>
<li><code>GET /futures/data/openInterestHist</code></li>
<li><code>GET /futures/data/topLongShortAccountRatio</code></li>
<li><code>GET /futures/data/topLongShortPositionRatio</code></li>
<li><code>GET /futures/data/globalLongShortAccountRatio</code></li>
</ul></li>
</ul>

<hr>

<p><font size="4"><strong>2020-02-26</strong></font></p>

<ul>
<li>新增订单类型:跟踪止损 <code>TRAILING_STOP_MARKET</code></li>
</ul>

<hr>

<p><font size="4"><strong>2020-02-20</strong></font></p>

<ul>
<li>新增接口以查询指定的当前挂单: <code>GET /fapi/v1/openOrder</code></li>
</ul>

<hr>

<p><font size="4"><strong>2020-02-17</strong></font></p>

<ul>
<li><code>&lt;symbol&gt;@ticker</code> 与 <code>!ticker@arr</code> 更新频率提升为1000ms</li>
<li>新增500ms更新的增量深度信息流选项: <code>&lt;symbol&gt;@depth@500ms</code></li>
<li>新增500ms更新的有限档深度信息流选项: <code>&lt;symbol&gt;@depth&lt;level&gt;@500ms</code></li>
</ul>

<hr>

<p><font size="4"><strong>2020-02-12</strong></font></p>

<ul>
<li><p>Java <a href="#sdk">SDK和代码示例</a> 发布</p></li>
<li><p>实现每秒更新的标记价格信息流选项:<br>
<code>&lt;symbol&gt;@markPrice@1s</code> and  <code>!markPrice@arr@1s</code> </p></li>
</ul>

<hr>

<p><font size="4"><strong>2020-02-05</strong></font></p>

<ul>
<li>新增接口<code>GET /fapi/v1/leverageBracket</code>: 查询杠杆分层标准。 </li>
</ul>

<hr>

<p><font size="4"><strong>2020-01-19</strong></font></p>

<ul>
<li>"cumQty" 字段将于未来几周从 <code>DELETE /fapi/v1/order</code>，<code>DELETE /fapi/v1/batchOrders</code> 等 <code>order</code> 相关接口的返回内容中去除，请使用 "executedQty" 字段予以替代。</li>
</ul>

<hr>

<p><font size="4"><strong>2020-1-17</strong></font></p>

<ul>
<li>Python <a href="#sdk">SDK和代码示例</a> 发布</li>
</ul>

<hr>

<p><font size="4"><strong>2020-1-6</strong></font></p>

<ul>
<li>实现实时更新的增量深度信息流选项: <code>&lt;symbol&gt;@depth@0ms</code></li>
</ul>

<hr>

<p><font size="4"><strong>2020-1-3</strong></font></p>

<ul>
<li><p>新增逐仓相关接口：</p>

<ul>
<li><code>POST /fapi/v1/marginType</code></li>
<li><code>POST /fapi/v1/positionMargin</code></li>
<li><code>GET /fapi/v1/positionMargin/history</code></li>
</ul></li>
<li><p>接口<code>GET /fapi/v1/positionRisk</code>新增返回内容:</p>

<ul>
<li><code>marginType</code></li>
<li><code>isolatedMargin</code></li>
</ul></li>
<li><p>接口<code>GET /fapi/v1/account</code>新增返回内容：<code>isolated</code></p></li>
<li><p><code>ACCOUNT_UPDATE</code> Balance和Position更新推送 增加：</p>

<ul>
<li>"cw": 除去逐仓保证金的钱包余额</li>
<li>"mt": 保证金模式</li>
<li>"iw": 若为逐仓，仓位保证金</li>
</ul></li>
</ul>

<hr>

<p><font size="4"><strong>2019-12-19</strong></font></p>

<ul>
<li>新增接口获取市场当前未平仓合约数： <code>GET /fapi/v1/openInterest</code></li>
</ul>

<hr>

<p><font size="4"><strong>2019-12-18</strong></font></p>

<ul>
<li>新增账户信息推送事件：<code>listenKeyExpired</code>。</li>
</ul>

<hr>

<p><font size="4"><strong>2019-12-12</strong></font></p>

<ul>
<li>新增接口撤销指定symbol的所有订单: <code>DELETE /fapi/v1/allOpenOrders</code></li>
<li>新增接口批量撤销订单：<code>DELETE /fapi/v1/batchOrders</code></li>
<li>新增支持仅减仓<code>reduceOnly</code>的订单类型：

<ul>
<li> <code>TAKE_PROFIT</code></li>
<li> <code>TAKE_PROFIT_MARKET</code></li>
<li> <code>STOP</code></li>
<li> <code>STOP_MARKET</code></li>
</ul></li>
</ul>

<hr>

<p><font size="4"><strong>2019-11-29</strong></font></p>

<ul>
<li>新增接口获取市场强平订单：<code>GET /fapi/v1/allForceOrders</code></li>
<li>新增市场行情推送：

<ul>
<li>强平订单：<code>&lt;symbol&gt;@forceOrder</code></li>
<li>全市场强平订单：<code>!forceOrder@arr</code></li>
</ul></li>
</ul>

<hr>

<p><font size="4"><strong>2019-11-25</strong></font></p>

<ul>
<li><code>GET /fapi/v1/account</code> 新增返回内容: <code>positions</code></li>
<li>以下接口新增返回值 <code>time</code> 表示订单创建时间:

<ul>
<li><code>GET /fapi/v1/openOrders</code></li>
<li><code>GET /fapi/v1/order</code></li>
<li><code>GET /fapi/v1/allOrders</code></li>
</ul></li>
</ul>

<hr>

<p><font size="4"><strong>2019-11-15</strong></font></p>

<ul>
<li>Websocket 新增市场行情流：

<ul>
<li><code>!miniTicker@arr</code>: 全市场的精简Ticker更新</li>
<li> <code>!ticker@arr</code>: : 全市场的完整Ticker更新</li>
</ul></li>
</ul>

<hr>

<p><font size="4"><strong>2019-11-12</strong></font></p>

<ul>
<li>WSS 支持实时订阅和取消数据流。</li>
</ul>

<hr>

<p><font size="4"><strong>2019-11-05</strong></font></p>

<ul>
<li>新增订单类型: 

<ul>
<li><code>STOP_MARKET</code>止损市价单，</li>
<li><code>TAKE_PROFIT_MARKET</code>止盈市价单</li>
</ul></li>
<li>下单新增可选参数: <code>workingType</code> 可选<code>stopPrice</code>由 "CONTRACT_PRICE" 或 "MARK_PRICE"触发</li>
<li>USER-DATA-STREAMS新增:

<ul>
<li><code>ORDER_TRADE_UPDATE</code>订单/交易 更新推送 增加：

<ul>
<li>"T": 撮合时间</li>
<li>"wt": workingType</li>
</ul></li>
<li><code>ACCOUNT_UPDATE</code> Balance和Position更新推送 增加："T": 撮合时间 </li>
</ul></li>
</ul>

<hr>

<p><font size="4"><strong>2019-10-28</strong></font></p>

<ul>
<li>新增接口查询账户损益资金流水：<code>GET /fapi/v1/income</code></li>
</ul>

<hr>

<p><font size="4"><strong>2019-10-25</strong></font></p>

<ul>
<li>账户信息推送事件<code>ACCOUNT_UPDATE</code>增加字段 "up"，表示持仓未实现盈亏。</li>
<li>账户信息推送事件<code>ORDER_TRADE_UPDATE</code>增加字段 "R"，表示该成交是否作为只减仓单。</li>
</ul>

<hr>

<p><font size="4"><strong>2019-10-24</strong></font></p>

<ul>
<li>新增最优挂单信息行情流: <code>&lt;symbol&gt;@bookTicker</code> 与<code>!bookTicker</code></li>
<li>新增有限档深度信息行情流： <code>&lt;symbol&gt;@depth&lt;levels&gt;</code> 与 <code>&lt;symbol&gt;@depth&lt;levels&gt;@100ms</code></li>
<li>更新频率达到100ms的更快的增量深度信息流选项: <code>&lt;symbol&gt;@depth@100ms</code></li>
<li><code>Websocket行情推送</code> 增加 <code>Update Speed</code> 更新速度</li>
</ul>

<hr>

<p><font size="4"><strong>2019-10-18</strong></font></p>

<ul>
<li>新增接口 <code>POST /fapi/v1/leverage</code> 以调整开仓杠杆倍数。</li>
<li>接口 <code>GET /fapi/v1/positionRisk</code> 的返回内容中新增字段：

<ul>
<li>"leverage": 当前开仓杠杆倍数；</li>
<li>"maxNotionalValue": 当前开仓杠杆倍数下的名义价值上限。</li>
</ul></li>
<li><code>MARKET</code> 市价单支持 <code>reduceOnly</code> 只减仓参数。 </li>
</ul>

<hr>

<p><font size="4"><strong>2019-10-14</strong></font></p>

<ul>
<li>新增接口<code>GET /fapi/v1/fundingRate</code>: 获取资金费率历史。</li>
</ul>

<hr>

<p><font size="4"><strong>2019-10-11</strong></font></p>

<ul>
<li>账户信息推送事件<code>ORDER_TRADE_UPDATE</code>增加字段 "m"，表示该成交是否作为挂单成交</li>
</ul>

<hr>

<p><font size="4"><strong>2019-10-08</strong></font></p>

<ul>
<li>新增限价指令订单参数 <code>reduceOnly</code> ：只减仓</li>
<li>新增订单类型 <code>TAKE_PROFIT</code>： 止盈单</li>
</ul>

<hr>

<p><font size="4"><strong>2019-09-20</strong></font></p>

<ul>
<li><p>GET /fapi/v1/account 新增返回值:<br>
<code>maxWithdrawAmount</code>, <code>openOrderInitialMargin</code>, <code>positionInitialMargin</code></p></li>
<li><p>GET /fapi/v1/positionRisk 新增返回值:<br>
<code>liquidationPrice</code></p></li>
</ul>
<h1 id="b122f813d5">基本信息</h1><h2 id="sdk">SDK和代码示例</h2>
<p><strong>免责声明:</strong></p>

<ul>
<li>以下SDK由合作方和用户提供，<strong>非官方制作</strong>行为。仅做熟悉api接口和学习使用，请广大用户谨慎使用并根据自身情况自行拓展研发。</li>
<li>Binance 官方不对SDK的安全和性能做任何承诺，亦不会对使用SDK引起的风险甚至损失承担责任。</li>
</ul>
<h3 id="python3">Python3</h3>
<p>可以通过以下方式获取SDK：    </p>

<ul>
<li><p>访问 <a href="https://github.com/Binance-docs/Binance_Futures_python">https://github.com/Binance-docs/Binance_Futures_python</a></p></li>
<li><p>执行以下命令：<br>
<code>
git clone https://github.com/Binance-docs/Binance_Futures_python.git
</code></p></li>
</ul>
<h3 id="java">Java</h3>
<p>可以通过以下方式获取SDK：<br>
* 访问 <a href="https://github.com/Binance-docs/Binance_Futures_Java">https://github.com/Binance-docs/Binance_Futures_Java</a>,   </p>

<ul>
<li>执行以下命令：<br>
<code>
git clone https://github.com/Binance-docs/Binance_Futures_Java.git
</code></li>
</ul>
<h2 id="rest">Rest 基本信息</h2>
<ul>
<li>接口可能需要用户的 API Key，如何创建API-KEY请参考<a href="https://www.binance.com/cn/support/articles/360002502072">这里</a></li>
<li>本篇列出REST接口的baseurl <strong>https://fapi.binance.com</strong></li>
<li>所有接口的响应都是JSON格式</li>
<li>响应中如有数组，数组元素以时间升序排列，越早的数据越提前。</li>
<li>所有时间、时间戳均为UNIX时间，单位为毫秒</li>
<li>所有数据类型采用JAVA的数据类型定义</li>
</ul>
<h2 id="testnet">testnet</h2>
<ul>
<li>本篇接口亦可接入testnet测试平台使用</li>
<li><strong>testnet</strong>的 REST baseurl 为 "https://testnet.binancefuture.com"</li>
<li><strong>testnet</strong>的 Websocket baseurl 为 "wss://stream.binancefuture.com"</li>
</ul>
<h3 id="http">HTTP 返回代码</h3>
<ul>
<li>HTTP <code>4XX</code> 错误码用于指示错误的请求内容、行为、格式。</li>
<li>HTTP <code>403</code> 错误码表示违反WAF限制(Web应用程序防火墙)。</li>
<li>HTTP <code>429</code> 错误码表示警告访问频次超限，即将被封IP</li>
<li>HTTP <code>418</code> 表示收到429后继续访问，于是被封了。</li>
<li>HTTP <code>5XX</code> 错误码用于指示Binance服务侧的问题。<br>
HTTP <code>503</code> 表示API服务端已经向业务核心提交了请求但未能获取响应，特别需要注意的是其不代表请求失败，而是未知。很可能已经得到了执行，也有可能执行失败，需要做进一步确认。</li>
</ul>
<h3 id="e8b5c91ed1">接口错误代码</h3>
<ul>
<li>每个接口都有可能抛出异常</li>
</ul>

<blockquote>
<p>异常响应格式如下：</p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">{</span>
  <span class="s2">"code"</span><span class="p">:</span> <span class="o">-</span><span class="mi">1121</span><span class="p">,</span>
  <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"Invalid symbol."</span>
<span class="p">}</span>
</code></pre>
<ul>
<li>具体的错误码及其解释在<a href="#cf68bca02a">错误代码</a></li>
</ul>
<h3 id="2be91f451e">接口的基本信息</h3>
<ul>
<li><code>GET</code>方法的接口, 参数必须在<code>query string</code>中发送.</li>
<li><code>POST</code>, <code>PUT</code>, 和 <code>DELETE</code> 方法的接口, 参数可以在 <code>query string</code>中发送，也可以在 <code>request body</code>中发送(content type <code>application/x-www-form-urlencoded</code>)。允许混合这两种方式发送参数。但如果同一个参数名在query string和request body中都有，query string中的会被优先采用。</li>
<li>对参数的顺序不做要求。</li>
</ul>
<h2 id="12907e94be">访问限制</h2>
<ul>
<li>在 <code>/fapi/v1/exchangeInfo</code>接口中<code>rateLimits</code>数组里包含有REST接口(不限于本篇的REST接口)的访问限制。包括带权重的访问频次限制、下单速率限制。本篇<code>枚举定义</code>章节有限制类型的进一步说明。</li>
<li>违反上述任何一个访问限制都会收到HTTP 429，这是一个警告.</li>
</ul>

<aside class="notice">
请注意，若用户被认定利用频繁挂撤单且故意低效交易意图发起攻击行为，Binance有权视具体情况进一步加强对其访问限制。
</aside>
<h3 id="ip">IP 访问限制</h3>
<ul>
<li>每个请求将包含一个<code>X-MBX-USED-WEIGHT-(intervalNum)(intervalLetter)</code>的头，其中包含当前IP所有请求的已使用权重。</li>
<li>每个路由都有一个"权重"，该权重确定每个接口计数的请求数。较重的接口和对多个交易对进行操作的接口将具有较重的"权重"。</li>
<li>收到429时，您有责任作为API退回而不向其发送更多的请求。</li>
<li><strong>如果屡次违反速率限制和/或在收到429后未能退回，将导致API的IP被禁(http状态418)。</strong></li>
<li>频繁违反限制，封禁时间会逐渐延长 ，<strong>对于重复违反者，将会被封从2分钟到3天</strong>。</li>
<li><strong>访问限制是基于IP的，而不是API Key</strong></li>
</ul>

<aside class="notice">
强烈建议您尽可能多地使用websocket消息获取相应数据,既可以保障消息的及时性，也可以减少请求带来的访问限制压力。
</aside>
<h3 id="b0ee61b8c8">下单频率限制</h3>
<ul>
<li>每个下单请求回报将包含一个<code>X-MBX-ORDER-COUNT-(intervalNum)(intervalLetter)</code>的头，其中包含当前账户已用的下单限制数量。</li>
<li>被拒绝或不成功的下单并不保证回报中包含以上头内容。</li>
<li><strong>下单频率限制是基于每个账户计数的。</strong></li>
</ul>
<h2 id="a573a19f9c">接口鉴权类型</h2>
<ul>
<li>每个接口都有自己的鉴权类型，鉴权类型决定了访问时应当进行何种鉴权</li>
<li>如果需要 API-key，应当在HTTP头中以<code>X-MBX-APIKEY</code>字段传递</li>
<li>API-key 与 API-secret 是大小写敏感的</li>
<li>可以在网页用户中心修改API-key 所具有的权限，例如读取账户信息、发送交易指令、发送提现指令</li>
</ul>

<table><thead>
<tr>
<th>鉴权类型</th>
<th>描述</th>
</tr>
</thead><tbody>
<tr>
<td>NONE</td>
<td>不需要鉴权的接口</td>
</tr>
<tr>
<td>TRADE</td>
<td>需要有效的API-KEY和签名</td>
</tr>
<tr>
<td>USER_DATA</td>
<td>需要有效的API-KEY和签名</td>
</tr>
<tr>
<td>USER_STREAM</td>
<td>需要有效的API-KEY</td>
</tr>
<tr>
<td>MARKET_DATA</td>
<td>需要有效的API-KEY</td>
</tr>
</tbody></table>
<h2 id="trade-user_data">需要签名的接口 (TRADE 与 USER_DATA)</h2>
<ul>
<li>调用这些接口时，除了接口本身所需的参数外，还需要传递<code>signature</code>即签名参数。</li>
<li>签名使用<code>HMAC SHA256</code>算法. API-KEY所对应的API-Secret作为 <code>HMAC SHA256</code> 的密钥，其他所有参数作为<code>HMAC SHA256</code>的操作对象，得到的输出即为签名。</li>
<li>签名大小写不敏感。</li>
<li>当同时使用query string和request body时，<code>HMAC SHA256</code>的输入query string在前，request body在后</li>
</ul>
<h3 id="a3d140c825">时间同步安全</h3>
<ul>
<li>签名接口均需要传递<code>timestamp</code>参数, 其值应当是请求发送时刻的unix时间戳(毫秒)</li>
<li>服务器收到请求时会判断请求中的时间戳，如果是5000毫秒之前发出的，则请求会被认为无效。这个时间窗口值可以通过发送可选参数<code>recvWindow</code>来自定义。</li>
<li>另外，如果服务器计算得出客户端时间戳在服务器时间的‘未来’一秒以上，也会拒绝请求。</li>
</ul>

<blockquote>
<p>逻辑伪代码：</p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code>  <span class="k">if</span> <span class="p">(</span><span class="nx">timestamp</span> <span class="o">&lt;</span> <span class="p">(</span><span class="nx">serverTime</span> <span class="o">+</span> <span class="mi">1000</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">serverTime</span> <span class="o">-</span> <span class="nx">timestamp</span><span class="p">)</span> <span class="o">&lt;=</span> <span class="nx">recvWindow</span><span class="p">)</span> <span class="p">{</span>
    <span class="c1">// process request</span>
  <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
    <span class="c1">// reject request</span>
  <span class="p">}</span>
</code></pre>
<p><strong>关于交易时效性</strong> 
互联网状况并不100%可靠，不可完全依赖,因此你的程序本地到币安服务器的时延会有抖动.
这是我们设置<code>recvWindow</code>的目的所在，如果你从事高频交易，对交易时效性有较高的要求，可以灵活设置recvWindow以达到你的要求。</p>

<aside class="notice">
不推荐使用5秒以上的recvWindow
</aside>
<h3 id="post-fapi-v1-order">POST /fapi/v1/order 的示例</h3>
<p>以下是在linux bash环境下使用 echo openssl 和curl工具实现的一个调用接口下单的示例
apikey、secret仅供示范</p>

<table><thead>
<tr>
<th>Key</th>
<th>Value</th>
</tr>
</thead><tbody>
<tr>
<td>apiKey</td>
<td>dbefbc809e3e83c283a984c3a1459732ea7db1360ca80c5c2c8867408d28cc83</td>
</tr>
<tr>
<td>secretKey</td>
<td>2b5eb11e18796d12d88f13dc27dbbd02c2cc51ff7059765ed9821957d82bb4d9</td>
</tr>
</tbody></table>

<table><thead>
<tr>
<th>参数</th>
<th>取值</th>
</tr>
</thead><tbody>
<tr>
<td>symbol</td>
<td>BTCUSDT</td>
</tr>
<tr>
<td>side</td>
<td>BUY</td>
</tr>
<tr>
<td>type</td>
<td>LIMIT</td>
</tr>
<tr>
<td>timeInForce</td>
<td>GTC</td>
</tr>
<tr>
<td>quantity</td>
<td>1</td>
</tr>
<tr>
<td>price</td>
<td>9000</td>
</tr>
<tr>
<td>recvWindow</td>
<td>5000</td>
</tr>
<tr>
<td>timestamp</td>
<td>1591702613943</td>
</tr>
</tbody></table>
<h3 id="1-query-string">示例 1: 所有参数通过 query string 发送</h3>
<blockquote>
<p><strong>示例1:</strong></p>

<p><strong>HMAC SHA256 签名:</strong></p>
</blockquote>
<pre class="highlight shell tab-shell"><code>    <span class="nv">$ </span><span class="nb">echo</span> -n <span class="s2">"symbol=BTCUSDT&amp;side=BUY&amp;type=LIMIT&amp;quantity=1&amp;price=9000&amp;timeInForce=GTC&amp;recvWindow=5000&amp;timestamp=1591702613943"</span> | openssl dgst -sha256 -hmac <span class="s2">"2b5eb11e18796d12d88f13dc27dbbd02c2cc51ff7059765ed9821957d82bb4d9"</span>
    <span class="o">(</span>stdin<span class="o">)=</span> 3c661234138461fcc7a7d8746c6558c9842d4e10870d2ecbedf7777cad694af9
</code></pre>
<blockquote>
<p><strong>curl 调用:</strong></p>
</blockquote>
<pre class="highlight shell tab-shell"><code>    <span class="o">(</span>HMAC SHA256<span class="o">)</span>
    <span class="nv">$ </span>curl -H <span class="s2">"X-MBX-APIKEY: dbefbc809e3e83c283a984c3a1459732ea7db1360ca80c5c2c8867408d28cc83"</span> -X POST <span class="s1">'https://fapi.binance.com/fapi/v1/order?symbol=BTCUSDT&amp;side=BUY&amp;type=LIMIT&amp;quantity=1&amp;price=9000&amp;timeInForce=GTC&amp;recvWindow=5000&amp;timestamp=1591702613943&amp;signature= 3c661234138461fcc7a7d8746c6558c9842d4e10870d2ecbedf7777cad694af9'</span>
</code></pre>
<ul>
<li><p><strong>queryString:</strong> </p>

<p>symbol=BTCUSDT<br>
&amp;side=BUY<br>
&amp;type=LIMIT<br>
&amp;timeInForce=GTC<br>
&amp;quantity=1<br>
&amp;price=0.1<br>
&amp;recvWindow=5000<br>
&amp;timestamp=1499827319559</p></li>
</ul>
<h3 id="2-request-body">示例 2: 所有参数通过 request body 发送</h3>
<blockquote>
<p><strong>示例2:</strong></p>

<p><strong>HMAC SHA256 签名:</strong></p>
</blockquote>
<pre class="highlight shell tab-shell"><code>    <span class="nv">$ </span><span class="nb">echo</span> -n <span class="s2">"symbol=BTCUSDT&amp;side=BUY&amp;type=LIMIT&amp;quantity=1&amp;price=9000&amp;timeInForce=GTC&amp;recvWindow=5000&amp;timestamp=1591702613943"</span> | openssl dgst -sha256 -hmac <span class="s2">"2b5eb11e18796d12d88f13dc27dbbd02c2cc51ff7059765ed9821957d82bb4d9"</span>
    <span class="o">(</span>stdin<span class="o">)=</span> 3c661234138461fcc7a7d8746c6558c9842d4e10870d2ecbedf7777cad694af9
</code></pre>
<blockquote>
<p><strong>curl 调用:</strong></p>
</blockquote>
<pre class="highlight shell tab-shell"><code>    <span class="o">(</span>HMAC SHA256<span class="o">)</span>
    <span class="nv">$ </span>curl -H <span class="s2">"X-MBX-APIKEY: dbefbc809e3e83c283a984c3a1459732ea7db1360ca80c5c2c8867408d28cc83"</span> -X POST <span class="s1">'https://fapi.binance.com/fapi/v1/order'</span> -d <span class="s1">'symbol=BTCUSDT&amp;side=BUY&amp;type=LIMIT&amp;quantity=1&amp;price=9000&amp;timeInForce=GTC&amp;recvWindow=5000&amp;timestamp=1591702613943&amp;signature= 3c661234138461fcc7a7d8746c6558c9842d4e10870d2ecbedf7777cad694af9'</span>
</code></pre>
<ul>
<li><p><strong>requestBody:</strong> </p>

<p>symbol=BTCUSDT<br>
&amp;side=BUY<br>
&amp;type=LIMIT<br>
&amp;timeInForce=GTC<br>
&amp;quantity=1<br>
&amp;price=9000<br>
&amp;recvWindow=5000<br>
&amp;timestamp=1591702613943</p></li>
</ul>
<h3 id="3-query-string-request-body">示例 3: 混合使用 query string 与 request body</h3>
<blockquote>
<p><strong>示例3:</strong></p>

<p><strong>HMAC SHA256 签名:</strong></p>
</blockquote>
<pre class="highlight shell tab-shell"><code>    <span class="nv">$ </span><span class="nb">echo</span> -n <span class="s2">"symbol=BTCUSDT&amp;side=BUY&amp;type=LIMIT&amp;quantity=1&amp;price=9000&amp;timeInForce=GTC&amp;recvWindow=5000&amp;timestamp=1591702613943"</span> | openssl dgst -sha256 -hmac <span class="s2">"2b5eb11e18796d12d88f13dc27dbbd02c2cc51ff7059765ed9821957d82bb4d9"</span>
    <span class="o">(</span>stdin<span class="o">)=</span> 3c661234138461fcc7a7d8746c6558c9842d4e10870d2ecbedf7777cad694af9
</code></pre>
<blockquote>
<p><strong>curl 调用:</strong></p>
</blockquote>
<pre class="highlight shell tab-shell"><code>    <span class="o">(</span>HMAC SHA256<span class="o">)</span>
    <span class="nv">$ </span>curl -H <span class="s2">"X-MBX-APIKEY: dbefbc809e3e83c283a984c3a1459732ea7db1360ca80c5c2c8867408d28cc83"</span> -X POST <span class="s1">'https://fapi.binance.com/fapi/v1/order?symbol=BTCUSDT&amp;side=BUY&amp;type=LIMIT&amp;timeInForce=GTC'</span> -d <span class="s1">'quantity=1&amp;price=9000&amp;recvWindow=5000&amp;timestamp=1591702613943&amp;signature=3c661234138461fcc7a7d8746c6558c9842d4e10870d2ecbedf7777cad694af9'</span>
</code></pre>
<ul>
<li><strong>queryString:</strong> symbol=BTCUSDT&amp;side=BUY&amp;type=LIMIT&amp;timeInForce=GTC</li>
<li><strong>requestBody:</strong> quantity=1&amp;price=9000&amp;recvWindow=5000&amp;timestamp= 1591702613943</li>
</ul>

<p>请注意，示例3中的签名有些许不同，在"GTC"和"quantity=1"之间<strong>没有</strong>"&amp;"字符。</p>
<h2 id="api">公开API参数</h2><h3 id="6db415da2a">术语解释</h3>
<ul>
<li><code>base asset</code> 指一个交易对的交易对象，即写在靠前部分的资产名</li>
<li><code>quote asset</code> 指一个交易对的定价资产，即写在靠后部分资产名</li>
</ul>
<h3 id="8c6d51826c">枚举定义</h3>
<p><strong>交易对类型:</strong></p>

<ul>
<li>FUTURE 期货</li>
</ul>

<p><strong>合约类型 (contractType):</strong></p>

<ul>
<li>PERPETUAL 永续合约</li>
<li>CURRENT_MONTH 当月交割合约</li>
<li>NEXT_MONTH 次月交割合约</li>
<li>CURRENT_QUARTER 当季交割合约</li>
<li>NEXT_QUARTER 次季交割合约 </li>
</ul>

<p><strong>合约状态 (contractStatus, status):</strong></p>

<ul>
<li>PENDING_TRADING   待上市</li>
<li>TRADING           交易中</li>
<li>PRE_DELIVERING        预交割</li>
<li>DELIVERING            交割中</li>
<li>DELIVERED         已交割</li>
<li>PRE_SETTLE            预结算</li>
<li>SETTLING          结算中</li>
<li>CLOSE             已下架</li>
</ul>

<p><strong>订单状态 (status):</strong></p>

<ul>
<li>NEW 新建订单</li>
<li>PARTIALLY_FILLED  部分成交</li>
<li>FILLED  全部成交</li>
<li>CANCELED  已撤销</li>
<li>REJECTED 订单被拒绝</li>
<li>EXPIRED 订单过期(根据timeInForce参数规则)</li>
</ul>

<p><strong>订单种类 (orderTypes, type):</strong></p>

<ul>
<li>LIMIT 限价单</li>
<li>MARKET 市价单</li>
<li>STOP 止损限价单</li>
<li>STOP_MARKET 止损市价单</li>
<li>TAKE_PROFIT 止盈限价单</li>
<li>TAKE_PROFIT_MARKET 止盈市价单</li>
<li>TRAILING_STOP_MARKET 跟踪止损单</li>
</ul>

<p><strong>订单方向 (side):</strong></p>

<ul>
<li>BUY 买入</li>
<li>SELL 卖出</li>
</ul>

<p><strong>持仓方向:</strong></p>

<ul>
<li>BOTH 单一持仓方向</li>
<li>LONG 多头(双向持仓下)</li>
<li>SHORT 空头(双向持仓下)</li>
</ul>

<p><strong>有效方式 (timeInForce):</strong></p>

<ul>
<li>GTC - Good Till Cancel 成交为止</li>
<li>IOC - Immediate or Cancel 无法立即成交(吃单)的部分就撤销</li>
<li>FOK - Fill or Kill 无法全部立即成交就撤销</li>
<li>GTX - Good Till Crossing 无法成为挂单方就撤销</li>
</ul>

<p><strong>条件价格触发类型 (workingType)</strong></p>

<ul>
<li>MARK_PRICE</li>
<li>CONTRACT_PRICE </li>
</ul>

<p><strong>响应类型 (newOrderRespType)</strong></p>

<ul>
<li>ACK</li>
<li>RESULT</li>
</ul>

<p><strong>K线间隔:</strong></p>

<p>m -&gt; 分钟; h -&gt; 小时; d -&gt; 天; w -&gt; 周; M -&gt; 月</p>

<ul>
<li>1m</li>
<li>3m</li>
<li>5m</li>
<li>15m</li>
<li>30m</li>
<li>1h</li>
<li>2h</li>
<li>4h</li>
<li>6h</li>
<li>8h</li>
<li>12h</li>
<li>1d</li>
<li>3d</li>
<li>1w</li>
<li>1M</li>
</ul>

<p><strong>限制种类 (rateLimitType)</strong></p>

<blockquote>
<p>REQUEST_WEIGHT</p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code>  <span class="p">{</span>
    <span class="s2">"rateLimitType"</span><span class="p">:</span> <span class="s2">"REQUEST_WEIGHT"</span><span class="p">,</span>
    <span class="s2">"interval"</span><span class="p">:</span> <span class="s2">"MINUTE"</span><span class="p">,</span>
    <span class="s2">"intervalNum"</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span>
    <span class="s2">"limit"</span><span class="p">:</span> <span class="mi">2400</span>
  <span class="p">}</span>
</code></pre>
<blockquote>
<p>ORDERS</p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code>  <span class="p">{</span>
    <span class="s2">"rateLimitType"</span><span class="p">:</span> <span class="s2">"ORDERS"</span><span class="p">,</span>
    <span class="s2">"interval"</span><span class="p">:</span> <span class="s2">"MINUTE"</span><span class="p">,</span>
    <span class="s2">"intervalNum"</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span>
    <span class="s2">"limit"</span><span class="p">:</span> <span class="mi">1200</span>
   <span class="p">}</span>
</code></pre>
<ul>
<li><p>REQUESTS_WEIGHT  单位时间请求权重之和上限</p></li>
<li><p>ORDERS    单位时间下单(撤单)次数上限</p></li>
</ul>

<p><strong>限制间隔</strong></p>

<ul>
<li>MINUTE</li>
</ul>
<h2 id="cc81fff589">过滤器</h2>
<p>过滤器，即Filter，定义了一系列交易规则。
共有两类，分别是针对交易对的过滤器<code>symbol filters</code>，和针对整个交易所的过滤器<code>exchange filters</code>(暂不支持)</p>
<h3 id="3967223109">交易对过滤器</h3><h4 id="price_filter">PRICE_FILTER 价格过滤器</h4>
<blockquote>
<p><strong>/exchangeInfo 响应中的格式:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code>  <span class="p">{</span>
    <span class="s2">"filterType"</span><span class="p">:</span> <span class="s2">"PRICE_FILTER"</span><span class="p">,</span>
    <span class="s2">"minPrice"</span><span class="p">:</span> <span class="s2">"0.00000100"</span><span class="p">,</span>
    <span class="s2">"maxPrice"</span><span class="p">:</span> <span class="s2">"100000.00000000"</span><span class="p">,</span>
    <span class="s2">"tickSize"</span><span class="p">:</span> <span class="s2">"0.00000100"</span>
  <span class="p">}</span>
</code></pre>
<p>价格过滤器用于检测order订单中price参数的合法性</p>

<ul>
<li><code>minPrice</code> 定义了 <code>price</code>/<code>stopPrice</code> 允许的最小值</li>
<li><code>maxPrice</code> 定义了 <code>price</code>/<code>stopPrice</code> 允许的最大值。</li>
<li><code>tickSize</code> 定义了 <code>price</code>/<code>stopPrice</code> 的步进间隔，即price必须等于minPrice+(tickSize的整数倍)
以上每一项均可为0，为0时代表这一项不再做限制。</li>
</ul>

<p>逻辑伪代码如下：</p>

<ul>
<li><code>price</code> &gt;= <code>minPrice</code></li>
<li><code>price</code> &lt;= <code>maxPrice</code></li>
<li>(<code>price</code>-<code>minPrice</code>) % <code>tickSize</code> == 0</li>
</ul>
<h4 id="lot_size">LOT_SIZE 订单尺寸</h4>
<blockquote>
<p><em>/exchangeInfo 响应中的格式:</em>*</p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code>  <span class="p">{</span>
    <span class="s2">"filterType"</span><span class="p">:</span> <span class="s2">"LOT_SIZE"</span><span class="p">,</span>
    <span class="s2">"minQty"</span><span class="p">:</span> <span class="s2">"0.00100000"</span><span class="p">,</span>
    <span class="s2">"maxQty"</span><span class="p">:</span> <span class="s2">"100000.00000000"</span><span class="p">,</span>
    <span class="s2">"stepSize"</span><span class="p">:</span> <span class="s2">"0.00100000"</span>
  <span class="p">}</span>
</code></pre>
<p>lots是拍卖术语，这个过滤器对订单中的<code>quantity</code>也就是数量参数进行合法性检查。包含三个部分：</p>

<ul>
<li><code>minQty</code> 表示 <code>quantity</code> 允许的最小值.</li>
<li><code>maxQty</code> 表示 <code>quantity</code> 允许的最大值</li>
<li><code>stepSize</code> 表示 <code>quantity</code>允许的步进值。</li>
</ul>

<p>逻辑伪代码如下：</p>

<ul>
<li><code>quantity</code> &gt;= <code>minQty</code></li>
<li><code>quantity</code> &lt;= <code>maxQty</code></li>
<li>(<code>quantity</code>-<code>minQty</code>) % <code>stepSize</code> == 0</li>
</ul>
<h4 id="market_lot_size">MARKET_LOT_SIZE 市价订单尺寸</h4>
<p>参考LOT_SIZE，区别仅在于对市价单还是限价单生效</p>
<h4 id="max_num_orders">MAX_NUM_ORDERS 最多订单数</h4>
<blockquote>
<p><strong>/exchangeInfo 响应中的格式:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code>  <span class="p">{</span>
    <span class="s2">"filterType"</span><span class="p">:</span> <span class="s2">"MAX_NUM_ORDERS"</span><span class="p">,</span>
    <span class="s2">"limit"</span><span class="p">:</span> <span class="mi">200</span>
  <span class="p">}</span>
</code></pre>
<p>定义了某个交易对最多允许的挂单数量(不包括已关闭的订单)</p>

<p>普通订单与条件订单均计算在内</p>
<h4 id="max_num_algo_orders">MAX_NUM_ALGO_ORDERS 最多条件订单数</h4>
<blockquote>
<p><strong>/exchangeInfo format:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code>  <span class="p">{</span>
    <span class="s2">"filterType"</span><span class="p">:</span> <span class="s2">"MAX_NUM_ALGO_ORDERS"</span><span class="p">,</span>
    <span class="s2">"limit"</span><span class="p">:</span> <span class="mi">100</span>
  <span class="p">}</span>
</code></pre>
<p>定义了某个交易对最多允许的条件订单的挂单数量(不包括已关闭的订单)。   </p>

<p>条件订单目前包括<code>STOP</code>, <code>STOP_MARKET</code>, <code>TAKE_PROFIT</code>, <code>TAKE_PROFIT_MARKET</code>, 和 <code>TRAILING_STOP_MARKET</code></p>
<h4 id="percent_price">PERCENT_PRICE 价格振幅过滤器</h4>
<blockquote>
<p><strong>/exchangeInfo 响应中的格式:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code>  <span class="p">{</span>
    <span class="s2">"filterType"</span><span class="p">:</span> <span class="s2">"PERCENT_PRICE"</span><span class="p">,</span>
    <span class="s2">"multiplierUp"</span><span class="p">:</span> <span class="s2">"1.1500"</span><span class="p">,</span>
    <span class="s2">"multiplierDown"</span><span class="p">:</span> <span class="s2">"0.8500"</span><span class="p">,</span>
    <span class="s2">"multiplierDecimal"</span><span class="p">:</span> <span class="mi">4</span>
  <span class="p">}</span>
</code></pre>
<p><code>PERCENT_PRICE</code> 定义了基于标记价格计算的挂单价格的可接受区间.</p>

<p>挂单价格必须同时满足以下条件：</p>

<ul>
<li>买单: <code>price</code> &lt;= <code>markPrice</code> * <code>multiplierUp</code></li>
<li>卖单: <code>price</code> &gt;= <code>markPrice</code> * <code>multiplierDown</code></li>
</ul>
<h4 id="min_notional">MIN_NOTIONAL 最小名义价值</h4>
<blockquote>
<p><strong>/exchangeInfo 响应中的格式:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code>  <span class="p">{</span>
    <span class="s2">"filterType"</span><span class="p">:</span> <span class="s2">"MIN_NOTIONAL"</span><span class="p">,</span>
    <span class="s2">"notioanl"</span><span class="p">:</span> <span class="s2">"1"</span>
  <span class="p">}</span>
</code></pre>
<p>MIN_NOTIONAL过滤器定义了交易对订单所允许的最小名义价值(成交额)。
订单的名义价值是<code>价格</code>*<code>数量</code>。 
由于<code>MARKET</code>订单没有价格，因此会使用 mark price 计算。   </p>

<hr>
<h2 id="postman-collections">Postman Collections</h2>
<p>现在你可以通过<code>Postman collection</code>来快速体验、使用API接口。<br>
如果想了解更多如果使用Postman，请访问<a href="https://github.com/binance-exchange/binance-api-postman">Binance API Postman</a></p>
<h1 id="ed913b7357">行情接口</h1><h2 id="ping">测试服务器连通性 PING</h2>
<p><code>
GET /fapi/v1/ping
</code></p>

<blockquote>
<p><strong>响应:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">{}</span>
</code></pre>
<p>测试能否联通</p>

<p><strong>权重:</strong>
1</p>

<p><strong>参数:</strong>
NONE</p>
<h2 id="3f1907847c">获取服务器时间</h2>
<blockquote>
<p><strong>响应:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">{</span>
  <span class="s2">"serverTime"</span><span class="p">:</span> <span class="mi">1499827319559</span> <span class="c1">// 当前的系统时间</span>
<span class="p">}</span>
</code></pre>
<p><code>
GET /fapi/v1/time
</code></p>

<p>获取服务器时间</p>

<p><strong>权重:</strong>
1</p>

<p><strong>参数:</strong>
NONE</p>
<h2 id="0f3f2d5ee7">获取交易规则和交易对</h2>
<blockquote>
<p><strong>响应:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">{</span>
    <span class="s2">"exchangeFilters"</span><span class="p">:</span> <span class="p">[],</span>
    <span class="s2">"rateLimits"</span><span class="p">:</span> <span class="p">[</span> <span class="c1">// API访问的限制</span>
        <span class="p">{</span>
            <span class="s2">"interval"</span><span class="p">:</span> <span class="s2">"MINUTE"</span><span class="p">,</span> <span class="c1">// 按照分钟计算</span>
            <span class="s2">"intervalNum"</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span> <span class="c1">// 按照1分钟计算</span>
            <span class="s2">"limit"</span><span class="p">:</span> <span class="mi">2400</span><span class="p">,</span> <span class="c1">// 上限次数</span>
            <span class="s2">"rateLimitType"</span><span class="p">:</span> <span class="s2">"REQUEST_WEIGHT"</span> <span class="c1">// 按照访问权重来计算</span>
        <span class="p">},</span>
        <span class="p">{</span>
            <span class="s2">"interval"</span><span class="p">:</span> <span class="s2">"MINUTE"</span><span class="p">,</span>
            <span class="s2">"intervalNum"</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span>
            <span class="s2">"limit"</span><span class="p">:</span> <span class="mi">1200</span><span class="p">,</span>
            <span class="s2">"rateLimitType"</span><span class="p">:</span> <span class="s2">"ORDERS"</span> <span class="c1">// 按照订单数量来计算</span>
        <span class="p">}</span>
    <span class="p">],</span>
    <span class="s2">"serverTime"</span><span class="p">:</span> <span class="mi">1565613908500</span><span class="p">,</span> <span class="c1">// 系统时间</span>
    <span class="s2">"assets"</span><span class="p">:</span> <span class="p">[</span> <span class="c1">// 资产信息</span>
        <span class="p">{</span>
            <span class="s2">"asset"</span><span class="p">:</span> <span class="s2">"BUSD"</span><span class="p">,</span>
            <span class="s2">"marginAvailable"</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span> <span class="c1">// 是否可用作保证金</span>
            <span class="s2">"autoAssetExchange"</span><span class="p">:</span> <span class="mi">0</span> <span class="c1">// 保证金资产自动兑换阈值</span>
        <span class="p">},</span>
        <span class="p">{</span>
            <span class="s2">"asset"</span><span class="p">:</span> <span class="s2">"USDT"</span><span class="p">,</span>
            <span class="s2">"marginAvailable"</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span> <span class="c1">// 是否可用作保证金</span>
            <span class="s2">"autoAssetExchange"</span><span class="p">:</span> <span class="mi">0</span> <span class="c1">// 保证金资产自动兑换阈值</span>
        <span class="p">},</span>
        <span class="p">{</span>
            <span class="s2">"asset"</span><span class="p">:</span> <span class="s2">"BNB"</span><span class="p">,</span>
            <span class="s2">"marginAvailable"</span><span class="p">:</span> <span class="kc">false</span><span class="p">,</span> <span class="c1">// 是否可用作保证金</span>
            <span class="s2">"autoAssetExchange"</span><span class="p">:</span> <span class="kc">null</span> <span class="c1">// 保证金资产自动兑换阈值</span>
        <span class="p">}</span>
    <span class="p">],</span>
    <span class="s2">"symbols"</span><span class="p">:</span> <span class="p">[</span> <span class="c1">// 交易对信息</span>
        <span class="p">{</span>
            <span class="s2">"symbol"</span><span class="p">:</span> <span class="s2">"BLZUSDT"</span><span class="p">,</span>  <span class="c1">// 交易对</span>
            <span class="s2">"pair"</span><span class="p">:</span> <span class="s2">"BLZUSDT"</span><span class="p">,</span>  <span class="c1">// 标的交易对</span>
            <span class="s2">"contractType"</span><span class="p">:</span> <span class="s2">"PERPETUAL"</span><span class="p">,</span>    <span class="c1">// 合约类型</span>
            <span class="s2">"deliveryDate"</span><span class="p">:</span> <span class="mi">4133404800000</span><span class="p">,</span>  <span class="c1">// 交割日期</span>
            <span class="s2">"onboardDate"</span><span class="p">:</span> <span class="mi">1598252400000</span><span class="p">,</span>     <span class="c1">// 上线日期</span>
            <span class="s2">"status"</span><span class="p">:</span> <span class="s2">"TRADING"</span><span class="p">,</span>  <span class="c1">// 交易对状态</span>
            <span class="s2">"maintMarginPercent"</span><span class="p">:</span> <span class="s2">"2.5000"</span><span class="p">,</span>  <span class="c1">// 请忽略</span>
            <span class="s2">"requiredMarginPercent"</span><span class="p">:</span> <span class="s2">"5.0000"</span><span class="p">,</span> <span class="c1">// 请忽略</span>
            <span class="s2">"baseAsset"</span><span class="p">:</span> <span class="s2">"BLZ"</span><span class="p">,</span>  <span class="c1">// 标的资产</span>
            <span class="s2">"quoteAsset"</span><span class="p">:</span> <span class="s2">"USDT"</span><span class="p">,</span> <span class="c1">// 报价资产</span>
            <span class="s2">"marginAsset"</span><span class="p">:</span> <span class="s2">"USDT"</span><span class="p">,</span> <span class="c1">// 保证金资产</span>
            <span class="s2">"pricePrecision"</span><span class="p">:</span> <span class="mi">5</span><span class="p">,</span>  <span class="c1">// 价格小数点位数(仅作为系统精度使用，注意同tickSize 区分）</span>
            <span class="s2">"quantityPrecision"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>  <span class="c1">// 数量小数点位数(仅作为系统精度使用，注意同stepSize 区分）</span>
            <span class="s2">"baseAssetPrecision"</span><span class="p">:</span> <span class="mi">8</span><span class="p">,</span>  <span class="c1">// 标的资产精度</span>
            <span class="s2">"quotePrecision"</span><span class="p">:</span> <span class="mi">8</span><span class="p">,</span>  <span class="c1">// 报价资产精度</span>
            <span class="s2">"underlyingType"</span><span class="p">:</span> <span class="s2">"COIN"</span><span class="p">,</span>
            <span class="s2">"underlyingSubType"</span><span class="p">:</span> <span class="p">[</span><span class="s2">"STORAGE"</span><span class="p">],</span>
            <span class="s2">"settlePlan"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
            <span class="s2">"triggerProtect"</span><span class="p">:</span> <span class="s2">"0.15"</span><span class="p">,</span> <span class="c1">// 开启"priceProtect"的条件订单的触发阈值</span>
            <span class="s2">"filters"</span><span class="p">:</span> <span class="p">[</span>
                <span class="p">{</span>
                    <span class="s2">"filterType"</span><span class="p">:</span> <span class="s2">"PRICE_FILTER"</span><span class="p">,</span> <span class="c1">// 价格限制</span>
                    <span class="s2">"maxPrice"</span><span class="p">:</span> <span class="s2">"300"</span><span class="p">,</span> <span class="c1">// 价格上限, 最大价格</span>
                    <span class="s2">"minPrice"</span><span class="p">:</span> <span class="s2">"0.0001"</span><span class="p">,</span> <span class="c1">// 价格下限, 最小价格</span>
                    <span class="s2">"tickSize"</span><span class="p">:</span> <span class="s2">"0.0001"</span> <span class="c1">// 订单最小价格间隔</span>
                <span class="p">},</span>
                <span class="p">{</span>
                    <span class="s2">"filterType"</span><span class="p">:</span> <span class="s2">"LOT_SIZE"</span><span class="p">,</span> <span class="c1">// 数量限制</span>
                    <span class="s2">"maxQty"</span><span class="p">:</span> <span class="s2">"10000000"</span><span class="p">,</span> <span class="c1">// 数量上限, 最大数量</span>
                    <span class="s2">"minQty"</span><span class="p">:</span> <span class="s2">"1"</span><span class="p">,</span> <span class="c1">// 数量下限, 最小数量</span>
                    <span class="s2">"stepSize"</span><span class="p">:</span> <span class="s2">"1"</span> <span class="c1">// 订单最小数量间隔</span>
                <span class="p">},</span>
                <span class="p">{</span>
                    <span class="s2">"filterType"</span><span class="p">:</span> <span class="s2">"MARKET_LOT_SIZE"</span><span class="p">,</span> <span class="c1">// 市价订单数量限制</span>
                    <span class="s2">"maxQty"</span><span class="p">:</span> <span class="s2">"590119"</span><span class="p">,</span> <span class="c1">// 数量上限, 最大数量</span>
                    <span class="s2">"minQty"</span><span class="p">:</span> <span class="s2">"1"</span><span class="p">,</span> <span class="c1">// 数量下限, 最小数量</span>
                    <span class="s2">"stepSize"</span><span class="p">:</span> <span class="s2">"1"</span> <span class="c1">// 允许的步进值</span>
                <span class="p">},</span>
                <span class="p">{</span>
                    <span class="s2">"filterType"</span><span class="p">:</span> <span class="s2">"MAX_NUM_ORDERS"</span><span class="p">,</span> <span class="c1">// 最多订单数限制</span>
                    <span class="s2">"limit"</span><span class="p">:</span> <span class="mi">200</span>
                <span class="p">},</span>
                <span class="p">{</span>
                    <span class="s2">"filterType"</span><span class="p">:</span> <span class="s2">"MAX_NUM_ALGO_ORDERS"</span><span class="p">,</span> <span class="c1">// 最多条件订单数限制</span>
                    <span class="s2">"limit"</span><span class="p">:</span> <span class="mi">100</span>
                <span class="p">},</span>
                <span class="p">{</span>
                    <span class="s2">"filterType"</span><span class="p">:</span> <span class="s2">"MIN_NOTIONAL"</span><span class="p">,</span>  <span class="c1">// 最小名义价值</span>
                    <span class="s2">"notional"</span><span class="p">:</span> <span class="s2">"1"</span><span class="p">,</span> 
                <span class="p">},</span>
                <span class="p">{</span>
                    <span class="s2">"filterType"</span><span class="p">:</span> <span class="s2">"PERCENT_PRICE"</span><span class="p">,</span> <span class="c1">// 价格比限制</span>
                    <span class="s2">"multiplierUp"</span><span class="p">:</span> <span class="s2">"1.1500"</span><span class="p">,</span> <span class="c1">// 价格上限百分比</span>
                    <span class="s2">"multiplierDown"</span><span class="p">:</span> <span class="s2">"0.8500"</span><span class="p">,</span> <span class="c1">// 价格下限百分比</span>
                    <span class="s2">"multiplierDecimal"</span><span class="p">:</span> <span class="mi">4</span>
                <span class="p">}</span>
            <span class="p">],</span>
            <span class="s2">"OrderType"</span><span class="p">:</span> <span class="p">[</span> <span class="c1">// 订单类型</span>
                <span class="s2">"LIMIT"</span><span class="p">,</span>  <span class="c1">// 限价单</span>
                <span class="s2">"MARKET"</span><span class="p">,</span>  <span class="c1">// 市价单</span>
                <span class="s2">"STOP"</span><span class="p">,</span> <span class="c1">// 止损单</span>
                <span class="s2">"STOP_MARKET"</span><span class="p">,</span> <span class="c1">// 止损市价单</span>
                <span class="s2">"TAKE_PROFIT"</span><span class="p">,</span> <span class="c1">// 止盈单</span>
                <span class="s2">"TAKE_PROFIT_MARKET"</span><span class="p">,</span> <span class="c1">// 止盈暑市价单</span>
                <span class="s2">"TRAILING_STOP_MARKET"</span> <span class="c1">// 跟踪止损市价单</span>
            <span class="p">],</span>
            <span class="s2">"timeInForce"</span><span class="p">:</span> <span class="p">[</span> <span class="c1">// 有效方式</span>
                <span class="s2">"GTC"</span><span class="p">,</span> <span class="c1">// 成交为止, 一直有效</span>
                <span class="s2">"IOC"</span><span class="p">,</span> <span class="c1">// 无法立即成交(吃单)的部分就撤销</span>
                <span class="s2">"FOK"</span><span class="p">,</span> <span class="c1">// 无法全部立即成交就撤销</span>
                <span class="s2">"GTX"</span> <span class="c1">// 无法成为挂单方就撤销</span>
            <span class="p">]</span>
        <span class="p">}</span>
    <span class="p">],</span>
    <span class="s2">"timezone"</span><span class="p">:</span> <span class="s2">"UTC"</span> <span class="c1">// 服务器所用的时间区域</span>
<span class="p">}</span>

</code></pre>
<p><code>
GET /fapi/v1/exchangeInfo
</code></p>

<p>获取交易规则和交易对</p>

<p><strong>权重:</strong>
1</p>

<p><strong>参数:</strong>
NONE</p>
<h2 id="38a975b802">深度信息</h2>
<blockquote>
<p><strong>响应:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">{</span>
  <span class="s2">"lastUpdateId"</span><span class="p">:</span> <span class="mi">1027024</span><span class="p">,</span>
  <span class="s2">"E"</span><span class="p">:</span> <span class="mi">1589436922972</span><span class="p">,</span>   <span class="c1">// 消息时间</span>
  <span class="s2">"T"</span><span class="p">:</span> <span class="mi">1589436922959</span><span class="p">,</span>   <span class="c1">// 撮合引擎时间</span>
  <span class="s2">"bids"</span><span class="p">:</span> <span class="p">[</span>             <span class="c1">// 买单</span>
    <span class="p">[</span>
      <span class="s2">"4.00000000"</span><span class="p">,</span>     <span class="c1">// 价格</span>
      <span class="s2">"431.00000000"</span>    <span class="c1">// 数量</span>
    <span class="p">]</span>
  <span class="p">],</span>
  <span class="s2">"asks"</span><span class="p">:</span> <span class="p">[</span>             <span class="c1">// 卖单</span>
    <span class="p">[</span>
      <span class="s2">"4.00000200"</span><span class="p">,</span>     <span class="c1">// 价格</span>
      <span class="s2">"12.00000000"</span>     <span class="c1">// 数量</span>
    <span class="p">]</span>
  <span class="p">]</span>
<span class="p">}</span>
</code></pre>
<p><code>
GET /fapi/v1/depth
</code></p>

<p><strong>权重:</strong></p>

<table><thead>
<tr>
<th>limit</th>
<th>权重</th>
</tr>
</thead><tbody>
<tr>
<td>5, 10, 20, 50</td>
<td>2</td>
</tr>
<tr>
<td>100</td>
<td>5</td>
</tr>
<tr>
<td>500</td>
<td>10</td>
</tr>
<tr>
<td>1000</td>
<td>20</td>
</tr>
</tbody></table>

<p><strong>参数:</strong></p>

<table><thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必需</th>
<th>描述</th>
</tr>
</thead><tbody>
<tr>
<td>symbol</td>
<td>STRING</td>
<td>YES</td>
<td>交易对</td>
</tr>
<tr>
<td>limit</td>
<td>INT</td>
<td>NO</td>
<td>默认 500; 可选值:[5, 10, 20, 50, 100, 500, 1000]</td>
</tr>
</tbody></table>
<h2 id="404aacd9b3">近期成交</h2>
<blockquote>
<p><strong>响应:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">[</span>
  <span class="p">{</span>
    <span class="s2">"id"</span><span class="p">:</span> <span class="mi">28457</span><span class="p">,</span>                <span class="c1">// 成交ID</span>
    <span class="s2">"price"</span><span class="p">:</span> <span class="s2">"4.00000100"</span><span class="p">,</span>      <span class="c1">// 成交价格</span>
    <span class="s2">"qty"</span><span class="p">:</span> <span class="s2">"12.00000000"</span><span class="p">,</span>       <span class="c1">// 成交量</span>
    <span class="s2">"quoteQty"</span><span class="p">:</span> <span class="s2">"48.00"</span><span class="p">,</span>        <span class="c1">// 成交额</span>
    <span class="s2">"time"</span><span class="p">:</span> <span class="mi">1499865549590</span><span class="p">,</span>      <span class="c1">// 时间</span>
    <span class="s2">"isBuyerMaker"</span><span class="p">:</span> <span class="kc">true</span>        <span class="c1">// 买方是否为挂单方</span>
  <span class="p">}</span>
<span class="p">]</span>
</code></pre>
<p><code>
GET /fapi/v1/trades
</code></p>

<p>获取近期成交</p>

<p><strong>权重:</strong>
1</p>

<p><strong>参数:</strong></p>

<table><thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必需</th>
<th>描述</th>
</tr>
</thead><tbody>
<tr>
<td>symbol</td>
<td>STRING</td>
<td>YES</td>
<td>交易对</td>
</tr>
<tr>
<td>limit</td>
<td>INT</td>
<td>NO</td>
<td>默认:500，最大1000</td>
</tr>
</tbody></table>
<h2 id="market_data">查询历史成交(MARKET_DATA)</h2>
<blockquote>
<p><strong>响应:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">[</span>
  <span class="p">{</span>
    <span class="s2">"id"</span><span class="p">:</span> <span class="mi">28457</span><span class="p">,</span>                <span class="c1">// 成交ID</span>
    <span class="s2">"price"</span><span class="p">:</span> <span class="s2">"4.00000100"</span><span class="p">,</span>      <span class="c1">// 成交价格</span>
    <span class="s2">"qty"</span><span class="p">:</span> <span class="s2">"12.00000000"</span><span class="p">,</span>       <span class="c1">// 成交量</span>
    <span class="s2">"quoteQty"</span><span class="p">:</span> <span class="s2">"48.00"</span><span class="p">,</span>        <span class="c1">// 成交额</span>
    <span class="s2">"time"</span><span class="p">:</span> <span class="mi">1499865549590</span><span class="p">,</span>      <span class="c1">// 时间</span>
    <span class="s2">"isBuyerMaker"</span><span class="p">:</span> <span class="kc">true</span>        <span class="c1">// 买方是否为挂单方</span>
  <span class="p">}</span>
<span class="p">]</span>
</code></pre>
<p><code>
GET /fapi/v1/historicalTrades
</code></p>

<p><strong>权重:</strong>
20</p>

<p><strong>参数:</strong></p>

<table><thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必需</th>
<th>描述</th>
</tr>
</thead><tbody>
<tr>
<td>symbol</td>
<td>STRING</td>
<td>YES</td>
<td>交易对</td>
</tr>
<tr>
<td>limit</td>
<td>INT</td>
<td>NO</td>
<td>默认值:500 最大值:1000.</td>
</tr>
<tr>
<td>fromId</td>
<td>LONG</td>
<td>NO</td>
<td>从哪一条成交id开始返回. 缺省返回最近的成交记录</td>
</tr>
</tbody></table>
<h2 id="c59e471e81">近期成交(归集)</h2>
<blockquote>
<p><strong>响应:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">[</span>
  <span class="p">{</span>
    <span class="s2">"a"</span><span class="p">:</span> <span class="mi">26129</span><span class="p">,</span>         <span class="c1">// 归集成交ID</span>
    <span class="s2">"p"</span><span class="p">:</span> <span class="s2">"0.01633102"</span><span class="p">,</span>  <span class="c1">// 成交价</span>
    <span class="s2">"q"</span><span class="p">:</span> <span class="s2">"4.70443515"</span><span class="p">,</span>  <span class="c1">// 成交量</span>
    <span class="s2">"f"</span><span class="p">:</span> <span class="mi">27781</span><span class="p">,</span>         <span class="c1">// 被归集的首个成交ID</span>
    <span class="s2">"l"</span><span class="p">:</span> <span class="mi">27781</span><span class="p">,</span>         <span class="c1">// 被归集的末个成交ID</span>
    <span class="s2">"T"</span><span class="p">:</span> <span class="mi">1498793709153</span><span class="p">,</span> <span class="c1">// 成交时间</span>
    <span class="s2">"m"</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span>          <span class="c1">// 是否为主动卖出单</span>
  <span class="p">}</span>
<span class="p">]</span>
</code></pre>
<p><code>
GET /fapi/v1/aggTrades
</code></p>

<p>归集交易与逐笔交易的区别在于，同一价格、同一方向、同一时间(按秒计算)的trade会被聚合为一条</p>

<p><strong>权重:</strong>
20</p>

<p><strong>参数:</strong></p>

<table><thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必需</th>
<th>描述</th>
</tr>
</thead><tbody>
<tr>
<td>symbol</td>
<td>STRING</td>
<td>YES</td>
<td>交易对</td>
</tr>
<tr>
<td>fromId</td>
<td>LONG</td>
<td>NO</td>
<td>从包含fromID的成交开始返回结果</td>
</tr>
<tr>
<td>startTime</td>
<td>LONG</td>
<td>NO</td>
<td>从该时刻之后的成交记录开始返回结果</td>
</tr>
<tr>
<td>endTime</td>
<td>LONG</td>
<td>NO</td>
<td>返回该时刻为止的成交记录</td>
</tr>
<tr>
<td>limit</td>
<td>INT</td>
<td>NO</td>
<td>默认 500; 最大 1000.</td>
</tr>
</tbody></table>

<ul>
<li>如果同时发送<code>startTime</code>和<code>endTime</code>，间隔必须小于一小时</li>
<li>如果没有发送任何筛选参数(<code>fromId</code>, <code>startTime</code>, <code>endTime</code>)，默认返回最近的成交记录</li>
</ul>
<h2 id="k">K线数据</h2>
<blockquote>
<p><strong>响应:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">[</span>
  <span class="p">[</span>
    <span class="mi">1499040000000</span><span class="p">,</span>      <span class="c1">// 开盘时间</span>
    <span class="s2">"0.01634790"</span><span class="p">,</span>       <span class="c1">// 开盘价</span>
    <span class="s2">"0.80000000"</span><span class="p">,</span>       <span class="c1">// 最高价</span>
    <span class="s2">"0.01575800"</span><span class="p">,</span>       <span class="c1">// 最低价</span>
    <span class="s2">"0.01577100"</span><span class="p">,</span>       <span class="c1">// 收盘价(当前K线未结束的即为最新价)</span>
    <span class="s2">"148976.11427815"</span><span class="p">,</span>  <span class="c1">// 成交量</span>
    <span class="mi">1499644799999</span><span class="p">,</span>      <span class="c1">// 收盘时间</span>
    <span class="s2">"2434.19055334"</span><span class="p">,</span>    <span class="c1">// 成交额</span>
    <span class="mi">308</span><span class="p">,</span>                <span class="c1">// 成交笔数</span>
    <span class="s2">"1756.87402397"</span><span class="p">,</span>    <span class="c1">// 主动买入成交量</span>
    <span class="s2">"28.46694368"</span><span class="p">,</span>      <span class="c1">// 主动买入成交额</span>
    <span class="s2">"17928899.62484339"</span> <span class="c1">// 请忽略该参数</span>
  <span class="p">]</span>
<span class="p">]</span>
</code></pre>
<p><code>
GET /fapi/v1/klines
</code></p>

<p>每根K线的开盘时间可视为唯一ID</p>

<p><strong>权重:</strong> 取决于请求中的LIMIT参数</p>

<table><thead>
<tr>
<th>LIMIT参数</th>
<th>权重</th>
</tr>
</thead><tbody>
<tr>
<td>[1,100)</td>
<td>1</td>
</tr>
<tr>
<td>[100, 500)</td>
<td>2</td>
</tr>
<tr>
<td>[500, 1000]</td>
<td>5</td>
</tr>
<tr>
<td>&gt; 1000</td>
<td>10</td>
</tr>
</tbody></table>

<p><strong>参数:</strong></p>

<table><thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必需</th>
<th>描述</th>
</tr>
</thead><tbody>
<tr>
<td>symbol</td>
<td>STRING</td>
<td>YES</td>
<td>交易对</td>
</tr>
<tr>
<td>interval</td>
<td>ENUM</td>
<td>YES</td>
<td>时间间隔</td>
</tr>
<tr>
<td>startTime</td>
<td>LONG</td>
<td>NO</td>
<td>起始时间</td>
</tr>
<tr>
<td>endTime</td>
<td>LONG</td>
<td>NO</td>
<td>结束时间</td>
</tr>
<tr>
<td>limit</td>
<td>INT</td>
<td>NO</td>
<td>默认值:500 最大值:1500.</td>
</tr>
</tbody></table>

<ul>
<li>缺省返回最近的数据</li>
</ul>
<h2 id="k-2">连续合约K线数据</h2>
<blockquote>
<p><strong>响应:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">[</span>
  <span class="p">[</span>
    <span class="mi">1607444700000</span><span class="p">,</span>      <span class="c1">// 开盘时间</span>
    <span class="s2">"18879.99"</span><span class="p">,</span>         <span class="c1">// 开盘价</span>
    <span class="s2">"18900.00"</span><span class="p">,</span>         <span class="c1">// 最高价</span>
    <span class="s2">"18878.98"</span><span class="p">,</span>         <span class="c1">// 最低价</span>
    <span class="s2">"18896.13"</span><span class="p">,</span>         <span class="c1">// 收盘价(当前K线未结束的即为最新价)</span>
    <span class="s2">"492.363"</span><span class="p">,</span>          <span class="c1">// 成交量</span>
    <span class="mi">1607444759999</span><span class="p">,</span>      <span class="c1">// 收盘时间</span>
    <span class="s2">"9302145.66080"</span><span class="p">,</span>    <span class="c1">// 成交额</span>
    <span class="mi">1874</span><span class="p">,</span>               <span class="c1">// 成交笔数</span>
    <span class="s2">"385.983"</span><span class="p">,</span>          <span class="c1">// 主动买入成交量</span>
    <span class="s2">"7292402.33267"</span><span class="p">,</span>    <span class="c1">// 主动买入成交额</span>
    <span class="s2">"0"</span>                 <span class="c1">// 请忽略该参数</span>
  <span class="p">]</span>
<span class="p">]</span>
</code></pre>
<p><code>
GET /fapi/v1/continuousKlines
</code>
每根K线的开盘时间可视为唯一ID</p>

<p><strong>权重:</strong> 取决于请求中的LIMIT参数</p>

<table><thead>
<tr>
<th>LIMIT参数</th>
<th>权重</th>
</tr>
</thead><tbody>
<tr>
<td>[1,100)</td>
<td>1</td>
</tr>
<tr>
<td>[100, 500)</td>
<td>2</td>
</tr>
<tr>
<td>[500, 1000]</td>
<td>5</td>
</tr>
<tr>
<td>&gt; 1000</td>
<td>10</td>
</tr>
</tbody></table>

<p><strong>参数:</strong></p>

<table><thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必需</th>
<th>描述</th>
</tr>
</thead><tbody>
<tr>
<td>pair</td>
<td>STRING</td>
<td>YES</td>
<td>标的交易对</td>
</tr>
<tr>
<td>contractType</td>
<td>ENUM</td>
<td>YES</td>
<td>合约类型</td>
</tr>
<tr>
<td>interval</td>
<td>ENUM</td>
<td>YES</td>
<td>时间间隔</td>
</tr>
<tr>
<td>startTime</td>
<td>LONG</td>
<td>NO</td>
<td>起始时间</td>
</tr>
<tr>
<td>endTime</td>
<td>LONG</td>
<td>NO</td>
<td>结束时间</td>
</tr>
<tr>
<td>limit</td>
<td>INT</td>
<td>NO</td>
<td>默认值:500 最大值:1500</td>
</tr>
</tbody></table>

<ul>
<li><p>缺省返回最近的数据</p></li>
<li><p>合约类型:</p>

<ul>
<li>PERPETUAL 永续合约 </li>
<li>CURRENT_MONTH 当月交割合约</li>
<li>NEXT_MONTH 次月交割合约</li>
<li>CURRENT_QUARTER 当季交割合约</li>
<li>NEXT_QUARTER 次季交割合约 </li>
</ul></li>
</ul>
<h2 id="k-3">价格指数K线数据</h2>
<blockquote>
<p><strong>响应:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">[</span>
  <span class="p">[</span>
    <span class="mi">1591256400000</span><span class="p">,</span>          <span class="c1">// 开盘时间</span>
    <span class="s2">"9653.69440000"</span><span class="p">,</span>        <span class="c1">// 开盘价</span>
    <span class="s2">"9653.69640000"</span><span class="p">,</span>        <span class="c1">// 最高价</span>
    <span class="s2">"9651.38600000"</span><span class="p">,</span>        <span class="c1">// 最低价</span>
    <span class="s2">"9651.55200000"</span><span class="p">,</span>        <span class="c1">// 收盘价(当前K线未结束的即为最新价)</span>
    <span class="s2">"0  "</span><span class="p">,</span>                  <span class="c1">// 请忽略</span>
    <span class="mi">1591256459999</span><span class="p">,</span>          <span class="c1">// 收盘时间</span>
    <span class="s2">"0"</span><span class="p">,</span>                    <span class="c1">// 请忽略</span>
    <span class="mi">60</span><span class="p">,</span>                     <span class="c1">// 构成记录数</span>
    <span class="s2">"0"</span><span class="p">,</span>                    <span class="c1">// 请忽略</span>
    <span class="s2">"0"</span><span class="p">,</span>                    <span class="c1">// 请忽略</span>
    <span class="s2">"0"</span>                     <span class="c1">// 请忽略</span>
  <span class="p">]</span>
<span class="p">]</span>
</code></pre>
<p><code>
GET /fapi/v1/indexPriceKlines
</code></p>

<p>每根K线的开盘时间可视为唯一ID</p>

<p><strong>权重:</strong> 取决于请求中的LIMIT参数</p>

<table><thead>
<tr>
<th>LIMIT参数</th>
<th>权重</th>
</tr>
</thead><tbody>
<tr>
<td>[1,100)</td>
<td>1</td>
</tr>
<tr>
<td>[100, 500)</td>
<td>2</td>
</tr>
<tr>
<td>[500, 1000]</td>
<td>5</td>
</tr>
<tr>
<td>&gt; 1000</td>
<td>10</td>
</tr>
</tbody></table>

<p><strong>参数:</strong></p>

<table><thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必需</th>
<th>描述</th>
</tr>
</thead><tbody>
<tr>
<td>pair</td>
<td>STRING</td>
<td>YES</td>
<td>标的交易对</td>
</tr>
<tr>
<td>interval</td>
<td>ENUM</td>
<td>YES</td>
<td>时间间隔</td>
</tr>
<tr>
<td>startTime</td>
<td>LONG</td>
<td>NO</td>
<td>起始时间</td>
</tr>
<tr>
<td>endTime</td>
<td>LONG</td>
<td>NO</td>
<td>结束时间</td>
</tr>
<tr>
<td>limit</td>
<td>INT</td>
<td>NO</td>
<td>默认值:500 最大值:1500</td>
</tr>
</tbody></table>

<ul>
<li>缺省返回最近的数据</li>
</ul>
<h2 id="k-4">标记价格K线数据</h2>
<blockquote>
<p><strong>响应:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">[</span>
  <span class="p">[</span>
    <span class="mi">1591256400000</span><span class="p">,</span>          <span class="c1">// 开盘时间</span>
    <span class="s2">"9653.69440000"</span><span class="p">,</span>        <span class="c1">// 开盘价</span>
    <span class="s2">"9653.69640000"</span><span class="p">,</span>        <span class="c1">// 最高价</span>
    <span class="s2">"9651.38600000"</span><span class="p">,</span>        <span class="c1">// 最低价</span>
    <span class="s2">"9651.55200000"</span><span class="p">,</span>        <span class="c1">// 收盘价(当前K线未结束的即为最新价)</span>
    <span class="s2">"0  "</span><span class="p">,</span>                  <span class="c1">// 请忽略</span>
    <span class="mi">1591256459999</span><span class="p">,</span>          <span class="c1">// 收盘时间</span>
    <span class="s2">"0"</span><span class="p">,</span>                    <span class="c1">// 请忽略</span>
    <span class="mi">60</span><span class="p">,</span>                     <span class="c1">// 构成记录数</span>
    <span class="s2">"0"</span><span class="p">,</span>                    <span class="c1">// 请忽略</span>
    <span class="s2">"0"</span><span class="p">,</span>                    <span class="c1">// 请忽略</span>
    <span class="s2">"0"</span>                     <span class="c1">// 请忽略</span>
  <span class="p">]</span>
<span class="p">]</span>
</code></pre>
<p><code>
GET /fapi/v1/markPriceKlines
</code>
每根K线的开盘时间可视为唯一ID</p>

<p><strong>权重:</strong> 取决于请求中的LIMIT参数</p>

<table><thead>
<tr>
<th>LIMIT参数</th>
<th>权重</th>
</tr>
</thead><tbody>
<tr>
<td>[1,100)</td>
<td>1</td>
</tr>
<tr>
<td>[100, 500)</td>
<td>2</td>
</tr>
<tr>
<td>[500, 1000]</td>
<td>5</td>
</tr>
<tr>
<td>&gt; 1000</td>
<td>10</td>
</tr>
</tbody></table>

<p><strong>参数:</strong></p>

<table><thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必需</th>
<th>描述</th>
</tr>
</thead><tbody>
<tr>
<td>symbol</td>
<td>STRING</td>
<td>YES</td>
<td>交易对</td>
</tr>
<tr>
<td>interval</td>
<td>ENUM</td>
<td>YES</td>
<td>时间间隔</td>
</tr>
<tr>
<td>startTime</td>
<td>LONG</td>
<td>NO</td>
<td>起始时间</td>
</tr>
<tr>
<td>endTime</td>
<td>LONG</td>
<td>NO</td>
<td>结束时间</td>
</tr>
<tr>
<td>limit</td>
<td>INT</td>
<td>NO</td>
<td>默认值:500 最大值:1500</td>
</tr>
</tbody></table>

<ul>
<li>缺省返回最近的数据</li>
</ul>
<h2 id="69f9b0b2f3">最新标记价格和资金费率</h2>
<blockquote>
<p><strong>响应:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">{</span>
    <span class="s2">"symbol"</span><span class="p">:</span> <span class="s2">"BTCUSDT"</span><span class="p">,</span>                <span class="c1">// 交易对</span>
    <span class="s2">"markPrice"</span><span class="p">:</span> <span class="s2">"11793.63104562"</span><span class="p">,</span>      <span class="c1">// 标记价格</span>
    <span class="s2">"indexPrice"</span><span class="p">:</span> <span class="s2">"11781.80495970"</span><span class="p">,</span>     <span class="c1">// 指数价格</span>
    <span class="s2">"lastFundingRate"</span><span class="p">:</span> <span class="s2">"0.00038246"</span><span class="p">,</span>    <span class="c1">// 最近更新的资金费率</span>
    <span class="s2">"nextFundingTime"</span><span class="p">:</span> <span class="mi">1597392000000</span><span class="p">,</span>   <span class="c1">// 下次资金费时间</span>
    <span class="s2">"interestRate"</span><span class="p">:</span> <span class="s2">"0.00010000"</span><span class="p">,</span>       <span class="c1">// 标的资产基础利率</span>
    <span class="s2">"time"</span><span class="p">:</span> <span class="mi">1597370495002</span>               <span class="c1">// 更新时间</span>
<span class="p">}</span>
</code></pre>
<blockquote>
<p><strong>当不指定symbol时相应</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">[</span>
    <span class="p">{</span>
        <span class="s2">"symbol"</span><span class="p">:</span> <span class="s2">"BTCUSDT"</span><span class="p">,</span>                <span class="c1">// 交易对</span>
        <span class="s2">"markPrice"</span><span class="p">:</span> <span class="s2">"11793.63104562"</span><span class="p">,</span>  <span class="c1">// 标记价格</span>
        <span class="s2">"indexPrice"</span><span class="p">:</span> <span class="s2">"11781.80495970"</span><span class="p">,</span> <span class="c1">// 指数价格</span>
        <span class="s2">"estimatedSettlePrice"</span><span class="p">:</span> <span class="s2">"11781.16138815"</span><span class="p">,</span>  <span class="c1">// 预估结算价,仅在交割开始前最后一小时有意义</span>
        <span class="s2">"lastFundingRate"</span><span class="p">:</span> <span class="s2">"0.00038246"</span><span class="p">,</span>    <span class="c1">// 最近更新的资金费率</span>
        <span class="s2">"nextFundingTime"</span><span class="p">:</span> <span class="mi">1597392000000</span><span class="p">,</span>   <span class="c1">// 下次资金费时间</span>
        <span class="s2">"interestRate"</span><span class="p">:</span> <span class="s2">"0.00010000"</span><span class="p">,</span>       <span class="c1">// 标的资产基础利率</span>
        <span class="s2">"time"</span><span class="p">:</span> <span class="mi">1597370495002</span>               <span class="c1">// 更新时间</span>
    <span class="p">}</span>
<span class="p">]</span>
</code></pre>
<p><code>
GET /fapi/v1/premiumIndex
</code></p>

<p>采集各大交易所数据加权平均</p>

<p><strong>权重:</strong>
1</p>

<p><strong>参数:</strong></p>

<table><thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必需</th>
<th>描述</th>
</tr>
</thead><tbody>
<tr>
<td>symbol</td>
<td>STRING</td>
<td>NO</td>
<td>交易对</td>
</tr>
</tbody></table>
<h2 id="31dbeb24c4">查询资金费率历史</h2>
<blockquote>
<p><strong>响应:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">[</span>
    <span class="p">{</span>
        <span class="s2">"symbol"</span><span class="p">:</span> <span class="s2">"BTCUSDT"</span><span class="p">,</span>            <span class="c1">// 交易对</span>
        <span class="s2">"fundingRate"</span><span class="p">:</span> <span class="s2">"-0.03750000"</span><span class="p">,</span>   <span class="c1">// 资金费率</span>
        <span class="s2">"fundingTime"</span><span class="p">:</span> <span class="mi">1570608000000</span><span class="p">,</span>   <span class="c1">// 资金费时间</span>
    <span class="p">},</span>
    <span class="p">{</span>
        <span class="s2">"symbol"</span><span class="p">:</span> <span class="s2">"BTCUSDT"</span><span class="p">,</span>
        <span class="s2">"fundingRate"</span><span class="p">:</span> <span class="s2">"0.00010000"</span><span class="p">,</span>
        <span class="s2">"fundingTime"</span><span class="p">:</span> <span class="mi">1570636800000</span><span class="p">,</span>
    <span class="p">}</span>
<span class="p">]</span>
</code></pre>
<p><code>
GET /fapi/v1/fundingRate
</code></p>

<p><strong>权重:</strong>
1</p>

<p><strong>参数:</strong></p>

<table><thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必需</th>
<th>描述</th>
</tr>
</thead><tbody>
<tr>
<td>symbol</td>
<td>STRING</td>
<td>NO</td>
<td>交易对</td>
</tr>
<tr>
<td>startTime</td>
<td>LONG</td>
<td>NO</td>
<td>起始时间</td>
</tr>
<tr>
<td>endTime</td>
<td>LONG</td>
<td>NO</td>
<td>结束时间</td>
</tr>
<tr>
<td>limit</td>
<td>INT</td>
<td>NO</td>
<td>默认值:100 最大值:1000</td>
</tr>
</tbody></table>

<ul>
<li>如果 <code>startTime</code> 和 <code>endTime</code> 都未发送, 返回最近 <code>limit</code> 条数据.</li>
<li>如果 <code>startTime</code> 和 <code>endTime</code> 之间的数据量大于 <code>limit</code>, 返回 <code>startTime</code> + <code>limit</code>情况下的数据。</li>
</ul>
<h2 id="24hr">24hr价格变动情况</h2>
<blockquote>
<p><strong>响应:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">{</span>
  <span class="s2">"symbol"</span><span class="p">:</span> <span class="s2">"BTCUSDT"</span><span class="p">,</span>
  <span class="s2">"priceChange"</span><span class="p">:</span> <span class="s2">"-94.99999800"</span><span class="p">,</span>    <span class="c1">//24小时价格变动</span>
  <span class="s2">"priceChangePercent"</span><span class="p">:</span> <span class="s2">"-95.960"</span><span class="p">,</span>  <span class="c1">//24小时价格变动百分比</span>
  <span class="s2">"weightedAvgPrice"</span><span class="p">:</span> <span class="s2">"0.29628482"</span><span class="p">,</span> <span class="c1">//加权平均价</span>
  <span class="s2">"lastPrice"</span><span class="p">:</span> <span class="s2">"4.00000200"</span><span class="p">,</span>        <span class="c1">//最近一次成交价</span>
  <span class="s2">"lastQty"</span><span class="p">:</span> <span class="s2">"200.00000000"</span><span class="p">,</span>        <span class="c1">//最近一次成交额</span>
  <span class="s2">"openPrice"</span><span class="p">:</span> <span class="s2">"99.00000000"</span><span class="p">,</span>       <span class="c1">//24小时内第一次成交的价格</span>
  <span class="s2">"highPrice"</span><span class="p">:</span> <span class="s2">"100.00000000"</span><span class="p">,</span>      <span class="c1">//24小时最高价</span>
  <span class="s2">"lowPrice"</span><span class="p">:</span> <span class="s2">"0.10000000"</span><span class="p">,</span>         <span class="c1">//24小时最低价</span>
  <span class="s2">"volume"</span><span class="p">:</span> <span class="s2">"8913.30000000"</span><span class="p">,</span>        <span class="c1">//24小时成交量</span>
  <span class="s2">"quoteVolume"</span><span class="p">:</span> <span class="s2">"15.30000000"</span><span class="p">,</span>     <span class="c1">//24小时成交额</span>
  <span class="s2">"openTime"</span><span class="p">:</span> <span class="mi">1499783499040</span><span class="p">,</span>        <span class="c1">//24小时内，第一笔交易的发生时间</span>
  <span class="s2">"closeTime"</span><span class="p">:</span> <span class="mi">1499869899040</span><span class="p">,</span>       <span class="c1">//24小时内，最后一笔交易的发生时间</span>
  <span class="s2">"firstId"</span><span class="p">:</span> <span class="mi">28385</span><span class="p">,</span>   <span class="c1">// 首笔成交id</span>
  <span class="s2">"lastId"</span><span class="p">:</span> <span class="mi">28460</span><span class="p">,</span>    <span class="c1">// 末笔成交id</span>
  <span class="s2">"count"</span><span class="p">:</span> <span class="mi">76</span>         <span class="c1">// 成交笔数</span>
<span class="p">}</span>
</code></pre>
<blockquote>
<p>或(当不发送交易对信息)</p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">[</span>
    <span class="p">{</span>
        <span class="s2">"symbol"</span><span class="p">:</span> <span class="s2">"BTCUSDT"</span><span class="p">,</span>
        <span class="s2">"priceChange"</span><span class="p">:</span> <span class="s2">"-94.99999800"</span><span class="p">,</span>    <span class="c1">//24小时价格变动</span>
        <span class="s2">"priceChangePercent"</span><span class="p">:</span> <span class="s2">"-95.960"</span><span class="p">,</span>  <span class="c1">//24小时价格变动百分比</span>
        <span class="s2">"weightedAvgPrice"</span><span class="p">:</span> <span class="s2">"0.29628482"</span><span class="p">,</span> <span class="c1">//加权平均价</span>
        <span class="s2">"lastPrice"</span><span class="p">:</span> <span class="s2">"4.00000200"</span><span class="p">,</span>        <span class="c1">//最近一次成交价</span>
        <span class="s2">"lastQty"</span><span class="p">:</span> <span class="s2">"200.00000000"</span><span class="p">,</span>        <span class="c1">//最近一次成交额</span>
        <span class="s2">"openPrice"</span><span class="p">:</span> <span class="s2">"99.00000000"</span><span class="p">,</span>       <span class="c1">//24小时内第一次成交的价格</span>
        <span class="s2">"highPrice"</span><span class="p">:</span> <span class="s2">"100.00000000"</span><span class="p">,</span>      <span class="c1">//24小时最高价</span>
        <span class="s2">"lowPrice"</span><span class="p">:</span> <span class="s2">"0.10000000"</span><span class="p">,</span>         <span class="c1">//24小时最低价</span>
        <span class="s2">"volume"</span><span class="p">:</span> <span class="s2">"8913.30000000"</span><span class="p">,</span>        <span class="c1">//24小时成交量</span>
        <span class="s2">"quoteVolume"</span><span class="p">:</span> <span class="s2">"15.30000000"</span><span class="p">,</span>     <span class="c1">//24小时成交额</span>
        <span class="s2">"openTime"</span><span class="p">:</span> <span class="mi">1499783499040</span><span class="p">,</span>        <span class="c1">//24小时内，第一笔交易的发生时间</span>
        <span class="s2">"closeTime"</span><span class="p">:</span> <span class="mi">1499869899040</span><span class="p">,</span>       <span class="c1">//24小时内，最后一笔交易的发生时间</span>
        <span class="s2">"firstId"</span><span class="p">:</span> <span class="mi">28385</span><span class="p">,</span>   <span class="c1">// 首笔成交id</span>
        <span class="s2">"lastId"</span><span class="p">:</span> <span class="mi">28460</span><span class="p">,</span>    <span class="c1">// 末笔成交id</span>
        <span class="s2">"count"</span><span class="p">:</span> <span class="mi">76</span>         <span class="c1">// 成交笔数</span>
    <span class="p">}</span>
<span class="p">]</span>
</code></pre>
<p><code>
GET /fapi/v1/ticker/24hr
</code></p>

<p>请注意，不携带symbol参数会返回全部交易对数据，不仅数据庞大，而且权重极高</p>

<p><strong>权重:</strong>
* 带symbol为<code>1</code>
* 不带为<code>40</code></p>

<p><strong>参数:</strong></p>

<table><thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必需</th>
<th>描述</th>
</tr>
</thead><tbody>
<tr>
<td>symbol</td>
<td>STRING</td>
<td>NO</td>
<td>交易对</td>
</tr>
</tbody></table>

<ul>
<li>不发送交易对参数，则会返回所有交易对信息</li>
</ul>
<h2 id="8ff46b58de">最新价格</h2>
<blockquote>
<p><strong>响应:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">{</span>
  <span class="s2">"symbol"</span><span class="p">:</span> <span class="s2">"LTCBTC"</span><span class="p">,</span>       <span class="c1">// 交易对</span>
  <span class="s2">"price"</span><span class="p">:</span> <span class="s2">"4.00000200"</span><span class="p">,</span>        <span class="c1">// 价格</span>
  <span class="s2">"time"</span><span class="p">:</span> <span class="mi">1589437530011</span>   <span class="c1">// 撮合引擎时间</span>
<span class="p">}</span>
</code></pre>
<blockquote>
<p>或(当不发送symbol)</p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">[</span>
    <span class="p">{</span>
        <span class="s2">"symbol"</span><span class="p">:</span> <span class="s2">"BTCUSDT"</span><span class="p">,</span>    <span class="c1">// 交易对</span>
        <span class="s2">"price"</span><span class="p">:</span> <span class="s2">"6000.01"</span><span class="p">,</span>     <span class="c1">// 价格</span>
        <span class="s2">"time"</span><span class="p">:</span> <span class="mi">1589437530011</span>   <span class="c1">// 撮合引擎时间</span>
    <span class="p">}</span>
<span class="p">]</span>
</code></pre>
<p><code>
GET /fapi/v1/ticker/price
</code></p>

<p>返回最近价格</p>

<p><strong>权重:</strong>
* 单交易对<code>1</code>
* 无交易对<code>2</code></p>

<p><strong>参数:</strong></p>

<table><thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必需</th>
<th>描述</th>
</tr>
</thead><tbody>
<tr>
<td>symbol</td>
<td>STRING</td>
<td>NO</td>
<td>交易对</td>
</tr>
</tbody></table>

<ul>
<li>不发送交易对参数，则会返回所有交易对信息</li>
</ul>
<h2 id="5393cd07b4">当前最优挂单</h2>
<blockquote>
<p><strong>响应:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">{</span>
  <span class="s2">"symbol"</span><span class="p">:</span> <span class="s2">"BTCUSDT"</span><span class="p">,</span> <span class="c1">// 交易对</span>
  <span class="s2">"bidPrice"</span><span class="p">:</span> <span class="s2">"4.00000000"</span><span class="p">,</span> <span class="c1">//最优买单价</span>
  <span class="s2">"bidQty"</span><span class="p">:</span> <span class="s2">"431.00000000"</span><span class="p">,</span> <span class="c1">//挂单量</span>
  <span class="s2">"askPrice"</span><span class="p">:</span> <span class="s2">"4.00000200"</span><span class="p">,</span> <span class="c1">//最优卖单价</span>
  <span class="s2">"askQty"</span><span class="p">:</span> <span class="s2">"9.00000000"</span><span class="p">,</span> <span class="c1">//挂单量</span>
  <span class="s2">"time"</span><span class="p">:</span> <span class="mi">1589437530011</span>   <span class="c1">// 撮合引擎时间</span>
<span class="p">}</span>
</code></pre>
<blockquote>
<p>或(当不发送symbol)</p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">[</span>
    <span class="p">{</span>
        <span class="s2">"symbol"</span><span class="p">:</span> <span class="s2">"BTCUSDT"</span><span class="p">,</span> <span class="c1">// 交易对</span>
        <span class="s2">"bidPrice"</span><span class="p">:</span> <span class="s2">"4.00000000"</span><span class="p">,</span> <span class="c1">//最优买单价</span>
        <span class="s2">"bidQty"</span><span class="p">:</span> <span class="s2">"431.00000000"</span><span class="p">,</span> <span class="c1">//挂单量</span>
        <span class="s2">"askPrice"</span><span class="p">:</span> <span class="s2">"4.00000200"</span><span class="p">,</span> <span class="c1">//最优卖单价</span>
        <span class="s2">"askQty"</span><span class="p">:</span> <span class="s2">"9.00000000"</span><span class="p">,</span> <span class="c1">//挂单量</span>
        <span class="s2">"time"</span><span class="p">:</span> <span class="mi">1589437530011</span>   <span class="c1">// 撮合引擎时间</span>
    <span class="p">}</span>
<span class="p">]</span>
</code></pre>
<p><code>
GET /fapi/v1/ticker/bookTicker
</code></p>

<p>返回当前最优的挂单(最高买单，最低卖单)</p>

<p><strong>权重:</strong>
* 单交易对<code>1</code><br>
* 无交易对<code>2</code></p>

<p><strong>参数:</strong></p>

<table><thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必需</th>
<th>描述</th>
</tr>
</thead><tbody>
<tr>
<td>symbol</td>
<td>STRING</td>
<td>NO</td>
<td>交易对</td>
</tr>
</tbody></table>

<ul>
<li>不发送交易对参数，则会返回所有交易对信息</li>
</ul>
<h2 id="f6cc22e496">获取未平仓合约数</h2>
<blockquote>
<p><strong>响应:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">{</span>
    <span class="s2">"openInterest"</span><span class="p">:</span> <span class="s2">"10659.509"</span><span class="p">,</span> <span class="c1">// 未平仓合约数量</span>
    <span class="s2">"symbol"</span><span class="p">:</span> <span class="s2">"BTCUSDT"</span><span class="p">,</span>    <span class="c1">// 交易对</span>
    <span class="s2">"time"</span><span class="p">:</span> <span class="mi">1589437530011</span>   <span class="c1">// 撮合引擎时间</span>
<span class="p">}</span>

</code></pre>
<p><code>
GET /fapi/v1/openInterest
</code></p>

<p><strong>权重:</strong> 1</p>

<p><strong>参数:</strong></p>

<table><thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必需</th>
<th>描述</th>
</tr>
</thead><tbody>
<tr>
<td>symbol</td>
<td>STRING</td>
<td>YES</td>
<td>交易对</td>
</tr>
</tbody></table>
<h2 id="c1c9193984">合约持仓量</h2>
<blockquote>
<p><strong>响应:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">[</span>
    <span class="p">{</span> 
         <span class="s2">"symbol"</span><span class="p">:</span><span class="s2">"BTCUSDT"</span><span class="p">,</span>
          <span class="s2">"sumOpenInterest"</span><span class="p">:</span><span class="s2">"20403.12345678"</span><span class="p">,</span><span class="c1">// 持仓总数量</span>
          <span class="s2">"sumOpenInterestValue"</span><span class="p">:</span> <span class="s2">"176196512.12345678"</span><span class="p">,</span> <span class="c1">// 持仓总价值</span>
          <span class="s2">"timestamp"</span><span class="p">:</span><span class="s2">"1583127900000"</span>

     <span class="p">},</span>

     <span class="p">{</span>

         <span class="s2">"symbol"</span><span class="p">:</span><span class="s2">"BTCUSDT"</span><span class="p">,</span>
         <span class="s2">"sumOpenInterest"</span><span class="p">:</span><span class="s2">"20401.36700000"</span><span class="p">,</span>
         <span class="s2">"sumOpenInterestValue"</span><span class="p">:</span><span class="s2">"149940752.14464448"</span><span class="p">,</span>
         <span class="s2">"timestamp"</span><span class="p">:</span><span class="s2">"1583128200000"</span>

        <span class="p">},</span>   

<span class="p">]</span>

</code></pre>
<p><code>
GET /futures/data/openInterestHist
</code></p>

<p><strong>权重:</strong> 1</p>

<p><strong>参数:</strong></p>

<table><thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必需</th>
<th>描述</th>
</tr>
</thead><tbody>
<tr>
<td>symbol</td>
<td>STRING</td>
<td>YES</td>
<td></td>
</tr>
<tr>
<td>period</td>
<td>ENUM</td>
<td>YES</td>
<td>"5m","15m","30m","1h","2h","4h","6h","12h","1d"</td>
</tr>
<tr>
<td>limit</td>
<td>LONG</td>
<td>NO</td>
<td>default 30, max 500</td>
</tr>
<tr>
<td>startTime</td>
<td>LONG</td>
<td>NO</td>
<td></td>
</tr>
<tr>
<td>endTime</td>
<td>LONG</td>
<td>NO</td>
<td></td>
</tr>
</tbody></table>

<ul>
<li>若无 startime 和 endtime 限制， 则默认返回当前时间往前的limit值</li>
<li>仅支持最近30天的数据</li>
</ul>
<h2 id="4d050dd845">大户账户数多空比</h2>
<blockquote>
<p><strong>响应:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">[</span>
    <span class="p">{</span> 
         <span class="s2">"symbol"</span><span class="p">:</span><span class="s2">"BTCUSDT"</span><span class="p">,</span>
          <span class="s2">"longShortRatio"</span><span class="p">:</span><span class="s2">"1.8105"</span><span class="p">,</span><span class="c1">// 大户多空账户数比值</span>
          <span class="s2">"longAccount"</span><span class="p">:</span> <span class="s2">"0.6442"</span><span class="p">,</span> <span class="c1">// 大户多仓账户数比例</span>
          <span class="s2">"shortAccount"</span><span class="p">:</span><span class="s2">"0.3558"</span><span class="p">,</span> <span class="c1">// 大户空仓账户数比例</span>
          <span class="s2">"timestamp"</span><span class="p">:</span><span class="s2">"1583139600000"</span>

     <span class="p">},</span>

     <span class="p">{</span>

         <span class="s2">"symbol"</span><span class="p">:</span><span class="s2">"BTCUSDT"</span><span class="p">,</span>
          <span class="s2">"longShortRatio"</span><span class="p">:</span><span class="s2">"1.8233"</span><span class="p">,</span>
          <span class="s2">"longAccount"</span><span class="p">:</span> <span class="s2">"0.5338"</span><span class="p">,</span> 
          <span class="s2">"shortAccount"</span><span class="p">:</span><span class="s2">"0.3454"</span><span class="p">,</span>                  
          <span class="s2">"timestamp"</span><span class="p">:</span><span class="s2">"1583139900000"</span>

        <span class="p">},</span>   

<span class="p">]</span>

</code></pre>
<p><code>
GET /futures/data/topLongShortAccountRatio
</code></p>

<p><strong>权重:</strong> 1</p>

<p><strong>参数:</strong></p>

<table><thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必需</th>
<th>描述</th>
</tr>
</thead><tbody>
<tr>
<td>symbol</td>
<td>STRING</td>
<td>YES</td>
<td></td>
</tr>
<tr>
<td>period</td>
<td>ENUM</td>
<td>YES</td>
<td>"5m","15m","30m","1h","2h","4h","6h","12h","1d"</td>
</tr>
<tr>
<td>limit</td>
<td>LONG</td>
<td>NO</td>
<td>default 30, max 500</td>
</tr>
<tr>
<td>startTime</td>
<td>LONG</td>
<td>NO</td>
<td></td>
</tr>
<tr>
<td>endTime</td>
<td>LONG</td>
<td>NO</td>
<td></td>
</tr>
</tbody></table>

<ul>
<li>若无 startime 和 endtime 限制， 则默认返回当前时间往前的limit值</li>
<li>仅支持最近30天的数据</li>
</ul>
<h2 id="269e531011">大户持仓量多空比</h2>
<blockquote>
<p><strong>响应:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">[</span>
    <span class="p">{</span> 
         <span class="s2">"symbol"</span><span class="p">:</span><span class="s2">"BTCUSDT"</span><span class="p">,</span>
          <span class="s2">"longShortRatio"</span><span class="p">:</span><span class="s2">"1.4342"</span><span class="p">,</span><span class="c1">// 大户多空持仓量比值</span>
          <span class="s2">"longAccount"</span><span class="p">:</span> <span class="s2">"0.5344"</span><span class="p">,</span> <span class="c1">// 大户多仓持仓量比例</span>
          <span class="s2">"shortAccount"</span><span class="p">:</span><span class="s2">"0.4238"</span><span class="p">,</span> <span class="c1">// 大户空仓持仓量比例</span>
          <span class="s2">"timestamp"</span><span class="p">:</span><span class="s2">"1583139600000"</span>

     <span class="p">},</span>

     <span class="p">{</span>

         <span class="s2">"symbol"</span><span class="p">:</span><span class="s2">"BTCUSDT"</span><span class="p">,</span>
          <span class="s2">"longShortRatio"</span><span class="p">:</span><span class="s2">"1.4337"</span><span class="p">,</span>
          <span class="s2">"longAccount"</span><span class="p">:</span> <span class="s2">"0.5891"</span><span class="p">,</span> 
          <span class="s2">"shortAccount"</span><span class="p">:</span><span class="s2">"0.4108"</span><span class="p">,</span>                  
          <span class="s2">"timestamp"</span><span class="p">:</span><span class="s2">"1583139900000"</span>

        <span class="p">},</span>   

<span class="p">]</span>

</code></pre>
<p><code>
GET /futures/data/topLongShortPositionRatio
</code></p>

<p><strong>权重:</strong> 1</p>

<p><strong>参数:</strong></p>

<table><thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必需</th>
<th>描述</th>
</tr>
</thead><tbody>
<tr>
<td>symbol</td>
<td>STRING</td>
<td>YES</td>
<td></td>
</tr>
<tr>
<td>period</td>
<td>ENUM</td>
<td>YES</td>
<td>"5m","15m","30m","1h","2h","4h","6h","12h","1d"</td>
</tr>
<tr>
<td>limit</td>
<td>LONG</td>
<td>NO</td>
<td>default 30, max 500</td>
</tr>
<tr>
<td>startTime</td>
<td>LONG</td>
<td>NO</td>
<td></td>
</tr>
<tr>
<td>endTime</td>
<td>LONG</td>
<td>NO</td>
<td></td>
</tr>
</tbody></table>

<ul>
<li>若无 startime 和 endtime 限制， 则默认返回当前时间往前的limit值</li>
<li>仅支持最近30天的数据</li>
</ul>
<h2 id="4d55ab5a20">多空持仓人数比</h2>
<blockquote>
<p><strong>响应:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">[</span>
    <span class="p">{</span> 
         <span class="s2">"symbol"</span><span class="p">:</span><span class="s2">"BTCUSDT"</span><span class="p">,</span>
          <span class="s2">"longShortRatio"</span><span class="p">:</span><span class="s2">"0.1960"</span><span class="p">,</span> <span class="c1">// 多空人数比值</span>
          <span class="s2">"longAccount"</span><span class="p">:</span> <span class="s2">"0.6622"</span><span class="p">,</span> <span class="c1">// 多仓人数比例</span>
          <span class="s2">"shortAccount"</span><span class="p">:</span><span class="s2">"0.3378"</span><span class="p">,</span> <span class="c1">// 空仓人数比例</span>
          <span class="s2">"timestamp"</span><span class="p">:</span><span class="s2">"1583139600000"</span>

     <span class="p">},</span>

     <span class="p">{</span>

         <span class="s2">"symbol"</span><span class="p">:</span><span class="s2">"BTCUSDT"</span><span class="p">,</span>
          <span class="s2">"longShortRatio"</span><span class="p">:</span><span class="s2">"1.9559"</span><span class="p">,</span>
          <span class="s2">"longAccount"</span><span class="p">:</span> <span class="s2">"0.6617"</span><span class="p">,</span> 
          <span class="s2">"shortAccount"</span><span class="p">:</span><span class="s2">"0.3382"</span><span class="p">,</span>                  
          <span class="s2">"timestamp"</span><span class="p">:</span><span class="s2">"1583139900000"</span>

        <span class="p">},</span>   

<span class="p">]</span>

</code></pre>
<p><code>
GET /futures/data/globalLongShortAccountRatio
</code></p>

<p><strong>权重:</strong> 1</p>

<p><strong>参数:</strong></p>

<table><thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必需</th>
<th>描述</th>
</tr>
</thead><tbody>
<tr>
<td>symbol</td>
<td>STRING</td>
<td>YES</td>
<td></td>
</tr>
<tr>
<td>period</td>
<td>ENUM</td>
<td>YES</td>
<td>"5m","15m","30m","1h","2h","4h","6h","12h","1d"</td>
</tr>
<tr>
<td>limit</td>
<td>LONG</td>
<td>NO</td>
<td>default 30, max 500</td>
</tr>
<tr>
<td>startTime</td>
<td>LONG</td>
<td>NO</td>
<td></td>
</tr>
<tr>
<td>endTime</td>
<td>LONG</td>
<td>NO</td>
<td></td>
</tr>
</tbody></table>

<ul>
<li>若无 startime 和 endtime 限制， 则默认返回当前时间往前的limit值</li>
<li>仅支持最近30天的数据</li>
</ul>
<h2 id="249be3ac39">合约主动买卖量</h2>
<blockquote>
<p><strong>响应:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">[</span>
    <span class="p">{</span> 
          <span class="s2">"buySellRatio"</span><span class="p">:</span><span class="s2">"1.5586"</span><span class="p">,</span>
          <span class="s2">"buyVol"</span><span class="p">:</span> <span class="s2">"387.3300"</span><span class="p">,</span> <span class="c1">// 主动买入量</span>
          <span class="s2">"sellVol"</span><span class="p">:</span><span class="s2">"248.5030"</span><span class="p">,</span> <span class="c1">// 主动卖出量</span>
          <span class="s2">"timestamp"</span><span class="p">:</span><span class="s2">"1585614900000"</span>

     <span class="p">},</span>

     <span class="p">{</span>

          <span class="s2">"buySellRatio"</span><span class="p">:</span><span class="s2">"1.3104"</span><span class="p">,</span>
          <span class="s2">"buyVol"</span><span class="p">:</span> <span class="s2">"343.9290"</span><span class="p">,</span> 
          <span class="s2">"sellVol"</span><span class="p">:</span><span class="s2">"248.5030"</span><span class="p">,</span>                     
          <span class="s2">"timestamp"</span><span class="p">:</span><span class="s2">"1583139900000"</span>

        <span class="p">},</span>   

<span class="p">]</span>

</code></pre>
<p><code>
GET /futures/data/takerlongshortRatio
</code></p>

<p><strong>权重:</strong> 1</p>

<p><strong>参数:</strong></p>

<table><thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必需</th>
<th>描述</th>
</tr>
</thead><tbody>
<tr>
<td>symbol</td>
<td>STRING</td>
<td>YES</td>
<td></td>
</tr>
<tr>
<td>period</td>
<td>ENUM</td>
<td>YES</td>
<td>"5m","15m","30m","1h","2h","4h","6h","12h","1d"</td>
</tr>
<tr>
<td>limit</td>
<td>LONG</td>
<td>NO</td>
<td>default 30, max 500</td>
</tr>
<tr>
<td>startTime</td>
<td>LONG</td>
<td>NO</td>
<td></td>
</tr>
<tr>
<td>endTime</td>
<td>LONG</td>
<td>NO</td>
<td></td>
</tr>
</tbody></table>

<ul>
<li>若无 startime 和 endtime 限制， 则默认返回当前时间往前的limit值</li>
<li>仅支持最近30天的数据</li>
</ul>
<h2 id="k-5">杠杆代币历史净值K线</h2>
<blockquote>
<p><strong>响应:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">[</span>
    <span class="p">[</span>
        <span class="mi">1598371200000</span><span class="p">,</span>      <span class="c1">// 开盘时间</span>
        <span class="s2">"5.88275270"</span><span class="p">,</span>       <span class="c1">// 开盘净值</span>
        <span class="s2">"6.03142087"</span><span class="p">,</span>       <span class="c1">// 最高净值</span>
        <span class="s2">"5.85749741"</span><span class="p">,</span>       <span class="c1">// 最低净值</span>
        <span class="s2">"5.99403551"</span><span class="p">,</span>       <span class="c1">// 收盘净值(当前K线未结束的即为最新净值)</span>
        <span class="s2">"2.28602984"</span><span class="p">,</span>       <span class="c1">// 收盘真实杠杆</span>
        <span class="mi">1598374799999</span><span class="p">,</span>      <span class="c1">// 收盘时间</span>
        <span class="s2">"0"</span><span class="p">,</span>                <span class="c1">// 请忽略</span>
        <span class="mi">6209</span><span class="p">,</span>               <span class="c1">// 净值更新笔数</span>
        <span class="s2">"14517.64507907"</span><span class="p">,</span>   <span class="c1">// 请忽略</span>
        <span class="s2">"0"</span><span class="p">,</span>                <span class="c1">// 请忽略</span>
        <span class="s2">"0"</span>                 <span class="c1">// 请忽略</span>
    <span class="p">]</span>
<span class="p">]</span>
</code></pre>
<p><code>GET /fapi/v1/lvtKlines</code></p>

<p>杠杆代币净值系统基于合约架构，故该接口采用fapi</p>

<p><strong>权重:</strong>
1</p>

<p><strong>参数:</strong></p>

<table><thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必需</th>
<th>描述</th>
</tr>
</thead><tbody>
<tr>
<td>symbol</td>
<td>STRING</td>
<td>YES</td>
<td>token name, e.g. "BTCDOWN", "BTCUP"</td>
</tr>
<tr>
<td>interval</td>
<td>ENUM</td>
<td>YES</td>
<td></td>
</tr>
<tr>
<td>startTime</td>
<td>LONG</td>
<td>NO</td>
<td></td>
</tr>
<tr>
<td>endTime</td>
<td>LONG</td>
<td>NO</td>
<td></td>
</tr>
<tr>
<td>limit</td>
<td>INT</td>
<td>NO</td>
<td>默认 500, 最大 1000</td>
</tr>
</tbody></table>

<ul>
<li>如果未发送 startTime 和 endTime ，默认返回最近的交易</li>
</ul>
<h2 id="669b9d47c2">综合指数交易对信息</h2>
<blockquote>
<p><strong>响应:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">[</span>
    <span class="p">{</span> 
        <span class="s2">"symbol"</span><span class="p">:</span> <span class="s2">"DEFIUSDT"</span><span class="p">,</span>
        <span class="s2">"time"</span><span class="p">:</span> <span class="mi">1589437530011</span><span class="p">,</span>   <span class="c1">// 请求时间</span>
        <span class="s2">"baseAssetList"</span><span class="p">:[</span>
            <span class="p">{</span>
                <span class="s2">"baseAsset"</span><span class="p">:</span><span class="s2">"BAL"</span><span class="p">,</span>  <span class="c1">// 基础资产</span>
                <span class="s2">"weightInQuantity"</span><span class="p">:</span><span class="s2">"1.04406228"</span><span class="p">,</span>  <span class="c1">//权重(数量)</span>
                <span class="s2">"weightInPercentage"</span><span class="p">:</span><span class="s2">"0.02783900"</span> <span class="c1">//权重(比例)</span>
            <span class="p">},</span>
            <span class="p">{</span>
                <span class="s2">"baseAsset"</span><span class="p">:</span><span class="s2">"BAND"</span><span class="p">,</span>
                <span class="s2">"weightInQuantity"</span><span class="p">:</span><span class="s2">"3.53782729"</span><span class="p">,</span>
                <span class="s2">"weightInPercentage"</span><span class="p">:</span><span class="s2">"0.03935200"</span>
            <span class="p">}</span>
        <span class="p">]</span>
    <span class="p">}</span>
<span class="p">]</span>

</code></pre>
<p>获取交易对为综合指数的基础成分信息。</p>

<p><code>
GET /fapi/v1/indexInfo
</code></p>

<p><strong>权重:</strong> 1</p>

<p><strong>参数:</strong></p>

<table><thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必需</th>
<th>描述</th>
</tr>
</thead><tbody>
<tr>
<td>symbol</td>
<td>STRING</td>
<td>NO</td>
<td></td>
</tr>
</tbody></table>
<h1 id="websocket">Websocket 行情推送</h1>
<ul>
<li>本篇所列出的所有wss接口baseurl: <strong>wss://fstream.binance.com</strong></li>
<li>订阅单一stream格式为 <strong>/ws/&lt;streamName&gt;</strong></li>
<li>组合streams的URL格式为 <strong>/stream?streams=&lt;streamName1&gt;/&lt;streamName2&gt;/&lt;streamName3&gt;</strong></li>
<li>订阅组合streams时，事件payload会以这样的格式封装 <strong>{"stream":"&lt;streamName&gt;","data":&lt;rawPayload&gt;}</strong></li>
<li>stream名称中所有交易对均为<strong>小写</strong></li>
<li>每个链接有效期不超过24小时，请妥善处理断线重连。</li>
<li>服务端每5分钟会发送ping帧，客户端应当在15分钟内回复pong帧，否则服务端会主动断开链接。允许客户端发送不成对的pong帧(即客户端可以以高于15分钟每次的频率发送pong帧保持链接)。</li>
<li>Websocket服务器每秒最多接受10个订阅消息。</li>
<li>如果用户发送的消息超过限制，连接会被断开连接。反复被断开连接的IP有可能被服务器屏蔽。</li>
<li>单个连接最多可以订阅 <strong>200</strong> 个Streams。</li>
</ul>
<h2 id="3c863d56da">实时订阅/取消数据流</h2>
<ul>
<li>以下数据可以通过websocket发送以实现订阅或取消订阅数据流。示例如下。</li>
<li>响应内容中的<code>id</code>是无符号整数，作为往来信息的唯一标识。</li>
</ul>
<h3 id="2a11d883e8">订阅一个信息流</h3>
<blockquote>
<p><strong>响应</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code>  <span class="p">{</span>
    <span class="s2">"result"</span><span class="p">:</span> <span class="kc">null</span><span class="p">,</span>
    <span class="s2">"id"</span><span class="p">:</span> <span class="mi">1</span>
  <span class="p">}</span>
</code></pre>
<ul>
<li><p><strong>请求</strong></p>

<p>{<br>
    "method": "SUBSCRIBE",<br>
    "params":<br>
    [<br>
    "btcusdt@aggTrade",<br>
    "btcusdt@depth"<br>
    ],<br>
    "id": 1<br>
}</p></li>
</ul>
<h3 id="122d1b11ee">取消订阅一个信息流</h3>
<blockquote>
<p><strong>响应</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code>  <span class="p">{</span>
    <span class="s2">"result"</span><span class="p">:</span> <span class="kc">null</span><span class="p">,</span>
    <span class="s2">"id"</span><span class="p">:</span> <span class="mi">312</span>
  <span class="p">}</span>
</code></pre>
<ul>
<li><strong>请求</strong></li>
</ul>

<p>{<br>
    "method": "UNSUBSCRIBE",<br>
    "params":<br>
    [<br>
      "btcusdt@depth"<br>
    ],<br>
    "id": 312<br>
  }</p>
<h3 id="08abf89cc1">已订阅信息流</h3>
<blockquote>
<p><strong>响应</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code>  <span class="p">{</span>
    <span class="s2">"result"</span><span class="p">:</span> <span class="p">[</span>
      <span class="s2">"btcusdt@aggTrade"</span>
    <span class="p">],</span>
    <span class="s2">"id"</span><span class="p">:</span> <span class="mi">3</span>
  <span class="p">}</span>
</code></pre>
<ul>
<li><strong>请求</strong></li>
</ul>

<p>{<br>
    "method": "LIST_SUBSCRIPTIONS",<br>
    "id": 3<br>
  }     </p>
<h3 id="e6bedc3d08">设定属性</h3>
<p>当前，唯一可以设置的属性是设置是否启用<code>combined</code>("组合")信息流。<br>
当使用<code>/ws/</code>("原始信息流")进行连接时，combined属性设置为<code>false</code>，而使用 <code>/stream/</code>进行连接时则将属性设置为<code>true</code>。</p>

<blockquote>
<p><strong>响应</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code>  <span class="p">{</span>
    <span class="s2">"result"</span><span class="p">:</span> <span class="kc">null</span>
    <span class="s2">"id"</span><span class="p">:</span> <span class="mi">5</span>
  <span class="p">}</span>
</code></pre>
<ul>
<li><strong>请求</strong></li>
</ul>

<p>{<br>
    "method": "SET_PROPERTY",<br>
    "params":<br>
    [<br>
      "combined",<br>
      true<br>
    ],<br>
    "id": 5<br>
  }</p>
<h3 id="d6190e3471">检索属性</h3>
<blockquote>
<p><strong>响应</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code>  <span class="p">{</span>
    <span class="s2">"result"</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span> <span class="c1">// Indicates that combined is set to true.</span>
    <span class="s2">"id"</span><span class="p">:</span> <span class="mi">2</span>
  <span class="p">}</span>
</code></pre>
<ul>
<li><strong>请求</strong></li>
</ul>

<p>{<br>
    "method": "GET_PROPERTY",<br>
    "params":<br>
    [<br>
      "combined"<br>
    ],<br>
    "id": 2<br>
  }   </p>
<h3 id="a38a81c9d5">错误信息</h3>
<table><thead>
<tr>
<th>错误信息</th>
<th>描述</th>
</tr>
</thead><tbody>
<tr>
<td>{"code": 0, "msg": "Unknown property"}</td>
<td><code>SET_PROPERTY</code> 或 <code>GET_PROPERTY</code>中应用的参数无效</td>
</tr>
<tr>
<td>{"code": 1, "msg": "Invalid value type: expected Boolean"}</td>
<td>仅接受<code>true</code>或<code>false</code></td>
</tr>
<tr>
<td>{"code": 2, "msg": "Invalid request: property name must be a string"}</td>
<td>提供的属性名无效</td>
</tr>
<tr>
<td>{"code": 2, "msg": "Invalid request: request ID must be an unsigned integer"}</td>
<td>参数<code>id</code>未提供或<code>id</code>值是无效类型</td>
</tr>
<tr>
<td>{"code": 2, "msg": "Invalid request: unknown variant %s, expected one of <code>SUBSCRIBE</code>, <code>UNSUBSCRIBE</code>, <code>LIST_SUBSCRIPTIONS</code>, <code>SET_PROPERTY</code>, <code>GET_PROPERTY</code> at line 1 column 28"}</td>
<td>错字提醒，或提供的值不是预期类型</td>
</tr>
<tr>
<td>{"code": 2, "msg": "Invalid request: too many parameters"}</td>
<td>数据中提供了不必要参数</td>
</tr>
<tr>
<td>{"code": 2, "msg": "Invalid request: property name must be a string"}</td>
<td>未提供属性名</td>
</tr>
<tr>
<td>{"code": 2, "msg": "Invalid request: missing field <code>method</code> at line 1 column 73"}</td>
<td>数据未提供<code>method</code></td>
</tr>
<tr>
<td>{"code":3,"msg":"Invalid JSON: expected value at line %s column %s"}</td>
<td>JSON 语法有误.</td>
</tr>
</tbody></table>
<h2 id="b14c7e3649">最新合约价格</h2>
<p>aggTrade中的价格'p'或ticker/miniTicker中的价格'c'均可以作为最新成交价。</p>
<h2 id="1e66c0284e">归集交易</h2>
<blockquote>
<p><strong>Payload:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">{</span>
  <span class="s2">"e"</span><span class="p">:</span> <span class="s2">"aggTrade"</span><span class="p">,</span>  <span class="c1">// 事件类型</span>
  <span class="s2">"E"</span><span class="p">:</span> <span class="mi">123456789</span><span class="p">,</span>   <span class="c1">// 事件时间</span>
  <span class="s2">"s"</span><span class="p">:</span> <span class="s2">"BNBUSDT"</span><span class="p">,</span>    <span class="c1">// 交易对</span>
  <span class="s2">"a"</span><span class="p">:</span> <span class="mi">5933014</span><span class="p">,</span>     <span class="c1">// 归集成交 ID</span>
  <span class="s2">"p"</span><span class="p">:</span> <span class="s2">"0.001"</span><span class="p">,</span>     <span class="c1">// 成交价格</span>
  <span class="s2">"q"</span><span class="p">:</span> <span class="s2">"100"</span><span class="p">,</span>       <span class="c1">// 成交量</span>
  <span class="s2">"f"</span><span class="p">:</span> <span class="mi">100</span><span class="p">,</span>         <span class="c1">// 被归集的首个交易ID</span>
  <span class="s2">"l"</span><span class="p">:</span> <span class="mi">105</span><span class="p">,</span>         <span class="c1">// 被归集的末次交易ID</span>
  <span class="s2">"T"</span><span class="p">:</span> <span class="mi">123456785</span><span class="p">,</span>   <span class="c1">// 成交时间</span>
  <span class="s2">"m"</span><span class="p">:</span> <span class="kc">true</span>         <span class="c1">// 买方是否是做市方。如true，则此次成交是一个主动卖出单，否则是一个主动买入单。</span>
<span class="p">}</span>
</code></pre>
<p>同一价格、同一方向、同一时间(100ms计算)的trade会被聚合为一条.</p>

<p><strong>Stream Name:</strong><br>
<code>&lt;symbol&gt;@aggTrade</code></p>

<p><strong>Update Speed:</strong> 100ms</p>
<h2 id="2feac0b7e2">最新标记价格</h2>
<blockquote>
<p><strong>Payload:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code>  <span class="p">{</span>
    <span class="s2">"e"</span><span class="p">:</span> <span class="s2">"markPriceUpdate"</span><span class="p">,</span>     <span class="c1">// 事件类型</span>
    <span class="s2">"E"</span><span class="p">:</span> <span class="mi">1562305380000</span><span class="p">,</span>         <span class="c1">// 事件时间</span>
    <span class="s2">"s"</span><span class="p">:</span> <span class="s2">"BTCUSDT"</span><span class="p">,</span>             <span class="c1">// 交易对</span>
    <span class="s2">"p"</span><span class="p">:</span> <span class="s2">"11794.15000000"</span><span class="p">,</span>      <span class="c1">// 标记价格</span>
    <span class="s2">"i"</span><span class="p">:</span> <span class="s2">"11784.62659091"</span><span class="p">,</span>      <span class="c1">// 现货指数价格</span>
    <span class="s2">"P"</span><span class="p">:</span> <span class="s2">"11784.25641265"</span><span class="p">,</span>      <span class="c1">// 预估结算价,仅在结算前最后一小时有参考价值</span>
    <span class="s2">"r"</span><span class="p">:</span> <span class="s2">"0.00038167"</span><span class="p">,</span>          <span class="c1">// 资金费率</span>
    <span class="s2">"T"</span><span class="p">:</span> <span class="mi">1562306400000</span>          <span class="c1">// 下次资金时间</span>
  <span class="p">}</span>
</code></pre>
<p><strong>Stream Name:</strong><br>
<code>&lt;symbol&gt;@markPrice</code> 或 <code>&lt;symbol&gt;@markPrice@1s</code></p>

<p><strong>Update Speed:</strong> 3000ms 或 1000ms</p>
<h2 id="7be41192f9">全市场最新标记价格</h2>
<blockquote>
<p><strong>Payload:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">[</span>
  <span class="p">{</span>
    <span class="s2">"e"</span><span class="p">:</span> <span class="s2">"markPriceUpdate"</span><span class="p">,</span>     <span class="c1">// 事件类型</span>
    <span class="s2">"E"</span><span class="p">:</span> <span class="mi">1562305380000</span><span class="p">,</span>         <span class="c1">// 事件时间</span>
    <span class="s2">"s"</span><span class="p">:</span> <span class="s2">"BTCUSDT"</span><span class="p">,</span>             <span class="c1">// 交易对</span>
    <span class="s2">"p"</span><span class="p">:</span> <span class="s2">"11185.87786614"</span><span class="p">,</span>      <span class="c1">// 标记价格</span>
    <span class="s2">"i"</span><span class="p">:</span> <span class="s2">"11784.62659091"</span>       <span class="c1">// 现货指数价格</span>
    <span class="s2">"P"</span><span class="p">:</span> <span class="s2">"11784.25641265"</span><span class="p">,</span>      <span class="c1">// 预估结算价,仅在结算前最后一小时有参考价值</span>
    <span class="s2">"r"</span><span class="p">:</span> <span class="s2">"0.00030000"</span><span class="p">,</span>          <span class="c1">// 资金费率</span>
    <span class="s2">"T"</span><span class="p">:</span> <span class="mi">1562306400000</span>          <span class="c1">// 下个资金时间</span>
  <span class="p">}</span>
<span class="p">]</span>
</code></pre>
<p><strong>Stream Name:</strong><br>
<code>!markPrice@arr</code> 或 <code>!markPrice@arr@1s</code></p>

<p><strong>Update Speed:</strong> 3000ms 或 1000ms</p>
<h2 id="k-6">K线</h2>
<blockquote>
<p><strong>Payload:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">{</span>
  <span class="s2">"e"</span><span class="p">:</span> <span class="s2">"kline"</span><span class="p">,</span>     <span class="c1">// 事件类型</span>
  <span class="s2">"E"</span><span class="p">:</span> <span class="mi">123456789</span><span class="p">,</span>   <span class="c1">// 事件时间</span>
  <span class="s2">"s"</span><span class="p">:</span> <span class="s2">"BNBUSDT"</span><span class="p">,</span>    <span class="c1">// 交易对</span>
  <span class="s2">"k"</span><span class="p">:</span> <span class="p">{</span>
    <span class="s2">"t"</span><span class="p">:</span> <span class="mi">123400000</span><span class="p">,</span> <span class="c1">// 这根K线的起始时间</span>
    <span class="s2">"T"</span><span class="p">:</span> <span class="mi">123460000</span><span class="p">,</span> <span class="c1">// 这根K线的结束时间</span>
    <span class="s2">"s"</span><span class="p">:</span> <span class="s2">"BNBUSDT"</span><span class="p">,</span>  <span class="c1">// 交易对</span>
    <span class="s2">"i"</span><span class="p">:</span> <span class="s2">"1m"</span><span class="p">,</span>      <span class="c1">// K线间隔</span>
    <span class="s2">"f"</span><span class="p">:</span> <span class="mi">100</span><span class="p">,</span>       <span class="c1">// 这根K线期间第一笔成交ID</span>
    <span class="s2">"L"</span><span class="p">:</span> <span class="mi">200</span><span class="p">,</span>       <span class="c1">// 这根K线期间末一笔成交ID</span>
    <span class="s2">"o"</span><span class="p">:</span> <span class="s2">"0.0010"</span><span class="p">,</span>  <span class="c1">// 这根K线期间第一笔成交价</span>
    <span class="s2">"c"</span><span class="p">:</span> <span class="s2">"0.0020"</span><span class="p">,</span>  <span class="c1">// 这根K线期间末一笔成交价</span>
    <span class="s2">"h"</span><span class="p">:</span> <span class="s2">"0.0025"</span><span class="p">,</span>  <span class="c1">// 这根K线期间最高成交价</span>
    <span class="s2">"l"</span><span class="p">:</span> <span class="s2">"0.0015"</span><span class="p">,</span>  <span class="c1">// 这根K线期间最低成交价</span>
    <span class="s2">"v"</span><span class="p">:</span> <span class="s2">"1000"</span><span class="p">,</span>    <span class="c1">// 这根K线期间成交量</span>
    <span class="s2">"n"</span><span class="p">:</span> <span class="mi">100</span><span class="p">,</span>       <span class="c1">// 这根K线期间成交笔数</span>
    <span class="s2">"x"</span><span class="p">:</span> <span class="kc">false</span><span class="p">,</span>     <span class="c1">// 这根K线是否完结(是否已经开始下一根K线)</span>
    <span class="s2">"q"</span><span class="p">:</span> <span class="s2">"1.0000"</span><span class="p">,</span>  <span class="c1">// 这根K线期间成交额</span>
    <span class="s2">"V"</span><span class="p">:</span> <span class="s2">"500"</span><span class="p">,</span>     <span class="c1">// 主动买入的成交量</span>
    <span class="s2">"Q"</span><span class="p">:</span> <span class="s2">"0.500"</span><span class="p">,</span>   <span class="c1">// 主动买入的成交额</span>
    <span class="s2">"B"</span><span class="p">:</span> <span class="s2">"123456"</span>   <span class="c1">// 忽略此参数</span>
  <span class="p">}</span>
<span class="p">}</span>
</code></pre>
<p>K线stream逐秒推送所请求的K线种类(最新一根K线)的更新。推送间隔250毫秒(如有刷新)</p>

<p><strong>订阅Kline需要提供间隔参数，最短为分钟线，最长为月线。支持以下间隔:</strong></p>

<p>m -&gt; 分钟; h -&gt; 小时; d -&gt; 天; w -&gt; 周; M -&gt; 月</p>

<ul>
<li>1m</li>
<li>3m</li>
<li>5m</li>
<li>15m</li>
<li>30m</li>
<li>1h</li>
<li>2h</li>
<li>4h</li>
<li>6h</li>
<li>8h</li>
<li>12h</li>
<li>1d</li>
<li>3d</li>
<li>1w</li>
<li>1M</li>
</ul>

<p><strong>Stream Name:</strong><br>
<code>&lt;symbol&gt;@kline_&lt;interval&gt;</code></p>

<p><strong>Update Speed:</strong> 250ms</p>
<h2 id="k-7">连续合约K线</h2>
<blockquote>
<p><strong>Payload:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">{</span>
  <span class="s2">"e"</span><span class="p">:</span><span class="s2">"continuous_kline"</span><span class="p">,</span>   <span class="c1">// 事件类型</span>
  <span class="s2">"E"</span><span class="p">:</span><span class="mi">1607443058651</span><span class="p">,</span>        <span class="c1">// 事件时间</span>
  <span class="s2">"ps"</span><span class="p">:</span><span class="s2">"BTCUSDT"</span><span class="p">,</span>           <span class="c1">// 标的交易对</span>
  <span class="s2">"ct"</span><span class="p">:</span><span class="s2">"PERPETUAL"</span><span class="p">,</span>         <span class="c1">// 合约类型 </span>
  <span class="s2">"k"</span><span class="p">:{</span>
    <span class="s2">"t"</span><span class="p">:</span><span class="mi">1607443020000</span><span class="p">,</span>      <span class="c1">// 这根K线的起始时间</span>
    <span class="s2">"T"</span><span class="p">:</span><span class="mi">1607443079999</span><span class="p">,</span>      <span class="c1">// 这根K线的结束时间</span>
    <span class="s2">"i"</span><span class="p">:</span><span class="s2">"1m"</span><span class="p">,</span>               <span class="c1">// K线间隔</span>
    <span class="s2">"f"</span><span class="p">:</span><span class="mi">116467658886</span><span class="p">,</span>       <span class="c1">// 这根K线期间第一笔成交ID</span>
    <span class="s2">"L"</span><span class="p">:</span><span class="mi">116468012423</span><span class="p">,</span>       <span class="c1">// 这根K线期间末一笔成交ID</span>
    <span class="s2">"o"</span><span class="p">:</span><span class="s2">"18787.00"</span><span class="p">,</span>         <span class="c1">// 这根K线期间第一笔成交价</span>
    <span class="s2">"c"</span><span class="p">:</span><span class="s2">"18804.04"</span><span class="p">,</span>         <span class="c1">// 这根K线期间末一笔成交价</span>
    <span class="s2">"h"</span><span class="p">:</span><span class="s2">"18804.04"</span><span class="p">,</span>         <span class="c1">// 这根K线期间最高成交价</span>
    <span class="s2">"l"</span><span class="p">:</span><span class="s2">"18786.54"</span><span class="p">,</span>         <span class="c1">// 这根K线期间最低成交价</span>
    <span class="s2">"v"</span><span class="p">:</span><span class="s2">"197.664"</span><span class="p">,</span>          <span class="c1">// 这根K线期间成交量</span>
    <span class="s2">"n"</span><span class="p">:</span><span class="mi">543</span><span class="p">,</span>                <span class="c1">// 这根K线期间成交笔数</span>
    <span class="s2">"x"</span><span class="p">:</span><span class="kc">false</span><span class="p">,</span>              <span class="c1">// 这根K线是否完结(是否已经开始下一根K线)</span>
    <span class="s2">"q"</span><span class="p">:</span><span class="s2">"3715253.19494"</span><span class="p">,</span>    <span class="c1">// 这根K线期间成交额</span>
    <span class="s2">"V"</span><span class="p">:</span><span class="s2">"184.769"</span><span class="p">,</span>          <span class="c1">// 主动买入的成交量</span>
    <span class="s2">"Q"</span><span class="p">:</span><span class="s2">"3472925.84746"</span><span class="p">,</span>    <span class="c1">// 主动买入的成交额</span>
    <span class="s2">"B"</span><span class="p">:</span><span class="s2">"0"</span>                 <span class="c1">// 忽略此参数</span>
  <span class="p">}</span>
<span class="p">}</span>
</code></pre>
<p>K线stream逐秒推送所请求的K线种类(最新一根K线)的更新。</p>

<p><strong>合约类型:</strong></p>

<ul>
<li>perpetual 永续合约</li>
<li>current_quarter 当季交割合约</li>
<li>next_quarter 次季交割合约</li>
</ul>

<p><strong>订阅Kline需要提供间隔参数,最短为分钟线,最长为月线。支持以下间隔:</strong></p>

<p>m -&gt; 分钟; h -&gt; 小时; d -&gt; 天; w -&gt; 周; M -&gt; 月</p>

<ul>
<li>1m</li>
<li>3m</li>
<li>5m</li>
<li>15m</li>
<li>30m</li>
<li>1h</li>
<li>2h</li>
<li>4h</li>
<li>6h</li>
<li>8h</li>
<li>12h</li>
<li>1d</li>
<li>3d</li>
<li>1w</li>
<li>1M</li>
</ul>

<p><strong>Stream Name:</strong><br>
<code>&lt;pair&gt;_&lt;contractType&gt;@continuousKline_&lt;interval&gt;</code></p>

<p><strong>Update Speed:</strong> 250ms</p>
<h2 id="symbol-ticker">按Symbol的精简Ticker</h2>
<blockquote>
<p><strong>Payload:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code>  <span class="p">{</span>
    <span class="s2">"e"</span><span class="p">:</span> <span class="s2">"24hrMiniTicker"</span><span class="p">,</span>  <span class="c1">// 事件类型</span>
    <span class="s2">"E"</span><span class="p">:</span> <span class="mi">123456789</span><span class="p">,</span>         <span class="c1">// 事件时间(毫秒)</span>
    <span class="s2">"s"</span><span class="p">:</span> <span class="s2">"BNBUSDT"</span><span class="p">,</span>          <span class="c1">// 交易对</span>
    <span class="s2">"c"</span><span class="p">:</span> <span class="s2">"0.0025"</span><span class="p">,</span>          <span class="c1">// 最新成交价格</span>
    <span class="s2">"o"</span><span class="p">:</span> <span class="s2">"0.0010"</span><span class="p">,</span>          <span class="c1">// 24小时前开始第一笔成交价格</span>
    <span class="s2">"h"</span><span class="p">:</span> <span class="s2">"0.0025"</span><span class="p">,</span>          <span class="c1">// 24小时内最高成交价</span>
    <span class="s2">"l"</span><span class="p">:</span> <span class="s2">"0.0010"</span><span class="p">,</span>          <span class="c1">// 24小时内最低成交价</span>
    <span class="s2">"v"</span><span class="p">:</span> <span class="s2">"10000"</span><span class="p">,</span>           <span class="c1">// 成交量</span>
    <span class="s2">"q"</span><span class="p">:</span> <span class="s2">"18"</span>               <span class="c1">// 成交额</span>
  <span class="p">}</span>
</code></pre>
<p>按Symbol刷新的24小时精简ticker信息.</p>

<p><strong>Stream Name:</strong><br>
`<code>&lt;symbol&gt;@miniTicker</code></p>

<p><strong>Update Speed:</strong> 500ms</p>
<h2 id="ticker">全市场的精简Ticker</h2>
<blockquote>
<p><strong>Payload:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">[</span>  
  <span class="p">{</span>
    <span class="s2">"e"</span><span class="p">:</span> <span class="s2">"24hrMiniTicker"</span><span class="p">,</span>  <span class="c1">// 事件类型</span>
    <span class="s2">"E"</span><span class="p">:</span> <span class="mi">123456789</span><span class="p">,</span>         <span class="c1">// 事件时间(毫秒)</span>
    <span class="s2">"s"</span><span class="p">:</span> <span class="s2">"BNBUSDT"</span><span class="p">,</span>          <span class="c1">// 交易对</span>
    <span class="s2">"c"</span><span class="p">:</span> <span class="s2">"0.0025"</span><span class="p">,</span>          <span class="c1">// 最新成交价格</span>
    <span class="s2">"o"</span><span class="p">:</span> <span class="s2">"0.0010"</span><span class="p">,</span>          <span class="c1">// 24小时前开始第一笔成交价格</span>
    <span class="s2">"h"</span><span class="p">:</span> <span class="s2">"0.0025"</span><span class="p">,</span>          <span class="c1">// 24小时内最高成交价</span>
    <span class="s2">"l"</span><span class="p">:</span> <span class="s2">"0.0010"</span><span class="p">,</span>          <span class="c1">// 24小时内最低成交价</span>
    <span class="s2">"v"</span><span class="p">:</span> <span class="s2">"10000"</span><span class="p">,</span>           <span class="c1">// 成交量</span>
    <span class="s2">"q"</span><span class="p">:</span> <span class="s2">"18"</span>               <span class="c1">// 成交额</span>
  <span class="p">}</span>
<span class="p">]</span>
</code></pre>
<p>所有symbol24小时精简ticker信息.需要注意的是，只有发生变化的ticker更新才会被推送。</p>

<p><strong>Stream Name:</strong><br>
<code>!miniTicker@arr</code></p>

<p><strong>Update Speed:</strong> 1000ms</p>
<h2 id="symbol-ticker-2">按Symbol的完整Ticker</h2>
<blockquote>
<p><strong>Payload:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">{</span>
  <span class="s2">"e"</span><span class="p">:</span> <span class="s2">"24hrTicker"</span><span class="p">,</span>  <span class="c1">// 事件类型</span>
  <span class="s2">"E"</span><span class="p">:</span> <span class="mi">123456789</span><span class="p">,</span>     <span class="c1">// 事件时间</span>
  <span class="s2">"s"</span><span class="p">:</span> <span class="s2">"BNBUSDT"</span><span class="p">,</span>      <span class="c1">// 交易对</span>
  <span class="s2">"p"</span><span class="p">:</span> <span class="s2">"0.0015"</span><span class="p">,</span>      <span class="c1">// 24小时价格变化</span>
  <span class="s2">"P"</span><span class="p">:</span> <span class="s2">"250.00"</span><span class="p">,</span>      <span class="c1">// 24小时价格变化(百分比)</span>
  <span class="s2">"w"</span><span class="p">:</span> <span class="s2">"0.0018"</span><span class="p">,</span>      <span class="c1">// 平均价格</span>
  <span class="s2">"c"</span><span class="p">:</span> <span class="s2">"0.0025"</span><span class="p">,</span>      <span class="c1">// 最新成交价格</span>
  <span class="s2">"Q"</span><span class="p">:</span> <span class="s2">"10"</span><span class="p">,</span>          <span class="c1">// 最新成交价格上的成交量</span>
  <span class="s2">"o"</span><span class="p">:</span> <span class="s2">"0.0010"</span><span class="p">,</span>      <span class="c1">// 24小时内第一比成交的价格</span>
  <span class="s2">"h"</span><span class="p">:</span> <span class="s2">"0.0025"</span><span class="p">,</span>      <span class="c1">// 24小时内最高成交价</span>
  <span class="s2">"l"</span><span class="p">:</span> <span class="s2">"0.0010"</span><span class="p">,</span>      <span class="c1">// 24小时内最低成交价</span>
  <span class="s2">"v"</span><span class="p">:</span> <span class="s2">"10000"</span><span class="p">,</span>       <span class="c1">// 24小时内成交量</span>
  <span class="s2">"q"</span><span class="p">:</span> <span class="s2">"18"</span><span class="p">,</span>          <span class="c1">// 24小时内成交额</span>
  <span class="s2">"O"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>             <span class="c1">// 统计开始时间</span>
  <span class="s2">"C"</span><span class="p">:</span> <span class="mi">86400000</span><span class="p">,</span>      <span class="c1">// 统计关闭时间</span>
  <span class="s2">"F"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>             <span class="c1">// 24小时内第一笔成交交易ID</span>
  <span class="s2">"L"</span><span class="p">:</span> <span class="mi">18150</span><span class="p">,</span>         <span class="c1">// 24小时内最后一笔成交交易ID</span>
  <span class="s2">"n"</span><span class="p">:</span> <span class="mi">18151</span>          <span class="c1">// 24小时内成交数</span>
<span class="p">}</span>
</code></pre>
<p>按Symbol刷新的24小时完整ticker信息</p>

<p><strong>Stream Name:</strong><br>
<code>&lt;symbol&gt;@ticker</code></p>

<p><strong>Update Speed:</strong> 500ms</p>
<h2 id="ticker-2">全市场的完整Ticker</h2>
<blockquote>
<p><strong>Payload:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">[</span>
    <span class="p">{</span>
      <span class="s2">"e"</span><span class="p">:</span> <span class="s2">"24hrTicker"</span><span class="p">,</span>  <span class="c1">// 事件类型</span>
      <span class="s2">"E"</span><span class="p">:</span> <span class="mi">123456789</span><span class="p">,</span>     <span class="c1">// 事件时间</span>
      <span class="s2">"s"</span><span class="p">:</span> <span class="s2">"BNBUSDT"</span><span class="p">,</span>      <span class="c1">// 交易对</span>
      <span class="s2">"p"</span><span class="p">:</span> <span class="s2">"0.0015"</span><span class="p">,</span>      <span class="c1">// 24小时价格变化</span>
      <span class="s2">"P"</span><span class="p">:</span> <span class="s2">"250.00"</span><span class="p">,</span>      <span class="c1">// 24小时价格变化(百分比)</span>
      <span class="s2">"w"</span><span class="p">:</span> <span class="s2">"0.0018"</span><span class="p">,</span>      <span class="c1">// 平均价格</span>
      <span class="s2">"c"</span><span class="p">:</span> <span class="s2">"0.0025"</span><span class="p">,</span>      <span class="c1">// 最新成交价格</span>
      <span class="s2">"Q"</span><span class="p">:</span> <span class="s2">"10"</span><span class="p">,</span>          <span class="c1">// 最新成交价格上的成交量</span>
      <span class="s2">"o"</span><span class="p">:</span> <span class="s2">"0.0010"</span><span class="p">,</span>      <span class="c1">// 24小时内第一比成交的价格</span>
      <span class="s2">"h"</span><span class="p">:</span> <span class="s2">"0.0025"</span><span class="p">,</span>      <span class="c1">// 24小时内最高成交价</span>
      <span class="s2">"l"</span><span class="p">:</span> <span class="s2">"0.0010"</span><span class="p">,</span>      <span class="c1">// 24小时内最低成交价</span>
      <span class="s2">"v"</span><span class="p">:</span> <span class="s2">"10000"</span><span class="p">,</span>       <span class="c1">// 24小时内成交量</span>
      <span class="s2">"q"</span><span class="p">:</span> <span class="s2">"18"</span><span class="p">,</span>          <span class="c1">// 24小时内成交额</span>
      <span class="s2">"O"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>             <span class="c1">// 统计开始时间</span>
      <span class="s2">"C"</span><span class="p">:</span> <span class="mi">86400000</span><span class="p">,</span>      <span class="c1">// 统计结束时间</span>
      <span class="s2">"F"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>             <span class="c1">// 24小时内第一笔成交交易ID</span>
      <span class="s2">"L"</span><span class="p">:</span> <span class="mi">18150</span><span class="p">,</span>         <span class="c1">// 24小时内最后一笔成交交易ID</span>
      <span class="s2">"n"</span><span class="p">:</span> <span class="mi">18151</span>          <span class="c1">// 24小时内成交数</span>
    <span class="p">}</span>
<span class="p">]</span>   
</code></pre>
<p>所有symbol 24小时完整ticker信息.需要注意的是，只有发生变化的ticker更新才会被推送。</p>

<p><strong>Stream Name:</strong><br>
<code>!ticker@arr</code></p>

<p><strong>Update Speed:</strong> 1000ms</p>
<h2 id="symbol">按Symbol的最优挂单信息</h2>
<blockquote>
<p><strong>Payload:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">{</span>
  <span class="s2">"e"</span><span class="p">:</span><span class="s2">"bookTicker"</span><span class="p">,</span>     <span class="c1">// 事件类型</span>
  <span class="s2">"u"</span><span class="p">:</span><span class="mi">400900217</span><span class="p">,</span>        <span class="c1">// 更新ID</span>
  <span class="s2">"E"</span><span class="p">:</span> <span class="mi">1568014460893</span><span class="p">,</span>   <span class="c1">// 事件推送时间</span>
  <span class="s2">"T"</span><span class="p">:</span> <span class="mi">1568014460891</span><span class="p">,</span>   <span class="c1">// 撮合时间</span>
  <span class="s2">"s"</span><span class="p">:</span><span class="s2">"BNBUSDT"</span><span class="p">,</span>        <span class="c1">// 交易对</span>
  <span class="s2">"b"</span><span class="p">:</span><span class="s2">"25.35190000"</span><span class="p">,</span>    <span class="c1">// 买单最优挂单价格</span>
  <span class="s2">"B"</span><span class="p">:</span><span class="s2">"31.21000000"</span><span class="p">,</span>    <span class="c1">// 买单最优挂单数量</span>
  <span class="s2">"a"</span><span class="p">:</span><span class="s2">"25.36520000"</span><span class="p">,</span>    <span class="c1">// 卖单最优挂单价格</span>
  <span class="s2">"A"</span><span class="p">:</span><span class="s2">"40.66000000"</span>     <span class="c1">// 卖单最优挂单数量</span>
<span class="p">}</span>
</code></pre>
<p>实时推送指定交易对最优挂单信息</p>

<p><strong>Stream Name:</strong> <code>&lt;symbol&gt;@bookTicker</code></p>

<p><strong>Update Speed:</strong> 实时</p>
<h2 id="3a40b1071b">全市场最优挂单信息</h2>
<blockquote>
<p><strong>Payload:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">{</span>
  <span class="c1">// Same as &lt;symbol&gt;@bookTicker payload</span>
<span class="p">}</span>
</code></pre>
<p>所有交易对交易对最优挂单信息</p>

<p><strong>Stream Name:</strong> <code>!bookTicker</code></p>

<p><strong>Update Speed:</strong> 实时</p>
<h2 id="2f03186fe7">强平订单</h2>
<blockquote>
<p><strong>Payload:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">{</span>

    <span class="s2">"e"</span><span class="p">:</span><span class="s2">"forceOrder"</span><span class="p">,</span><span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span><span class="c1">// 事件类型</span>
    <span class="s2">"E"</span><span class="p">:</span><span class="mi">1568014460893</span><span class="p">,</span><span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="c1">// 事件时间</span>
    <span class="s2">"o"</span><span class="p">:{</span>

        <span class="s2">"s"</span><span class="p">:</span><span class="s2">"BTCUSDT"</span><span class="p">,</span><span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span><span class="c1">// 交易对</span>
        <span class="s2">"S"</span><span class="p">:</span><span class="s2">"SELL"</span><span class="p">,</span><span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="c1">// 订单方向</span>
        <span class="s2">"o"</span><span class="p">:</span><span class="s2">"LIMIT"</span><span class="p">,</span><span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span><span class="c1">// 订单类型</span>
        <span class="s2">"f"</span><span class="p">:</span><span class="s2">"IOC"</span><span class="p">,</span><span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span><span class="c1">// 有效方式</span>
        <span class="s2">"q"</span><span class="p">:</span><span class="s2">"0.014"</span><span class="p">,</span><span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span><span class="c1">// 订单数量</span>
        <span class="s2">"p"</span><span class="p">:</span><span class="s2">"9910"</span><span class="p">,</span><span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="c1">// 订单价格</span>
        <span class="s2">"ap"</span><span class="p">:</span><span class="s2">"9910"</span><span class="p">,</span><span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span><span class="c1">// 平均价格</span>
        <span class="s2">"X"</span><span class="p">:</span><span class="s2">"FILLED"</span><span class="p">,</span><span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="c1">// 订单状态</span>
        <span class="s2">"l"</span><span class="p">:</span><span class="s2">"0.014"</span><span class="p">,</span><span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span><span class="c1">// 订单最近成交量</span>
        <span class="s2">"z"</span><span class="p">:</span><span class="s2">"0.014"</span><span class="p">,</span><span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span><span class="c1">// 订单累计成交量</span>
        <span class="s2">"T"</span><span class="p">:</span><span class="mi">1568014460893</span><span class="p">,</span><span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span>     <span class="c1">// 交易时间</span>

    <span class="p">}</span>

<span class="p">}</span>
</code></pre>
<p>推送特定<code>symbol</code>的强平订单快照信息。</p>

<p>1000ms内至多仅推送一条最近的强平订单作为快照</p>

<p><strong>Stream Name:</strong>&nbsp;&nbsp;<code>&lt;symbol&gt;@forceOrder</code></p>

<p><strong>Update Speed:</strong> 1000ms</p>
<h2 id="b1d3fbf198">全市场强平订单</h2>
<blockquote>
<p><strong>Payload:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">{</span>

    <span class="s2">"e"</span><span class="p">:</span><span class="s2">"forceOrder"</span><span class="p">,</span><span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span><span class="c1">// 事件类型</span>
    <span class="s2">"E"</span><span class="p">:</span><span class="mi">1568014460893</span><span class="p">,</span><span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="c1">// 事件时间</span>
    <span class="s2">"o"</span><span class="p">:{</span>

        <span class="s2">"s"</span><span class="p">:</span><span class="s2">"BTCUSDT"</span><span class="p">,</span><span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span><span class="c1">// 交易对</span>
        <span class="s2">"S"</span><span class="p">:</span><span class="s2">"SELL"</span><span class="p">,</span><span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="c1">// 订单方向</span>
        <span class="s2">"o"</span><span class="p">:</span><span class="s2">"LIMIT"</span><span class="p">,</span><span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span><span class="c1">// 订单类型</span>
        <span class="s2">"f"</span><span class="p">:</span><span class="s2">"IOC"</span><span class="p">,</span><span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span><span class="c1">// 有效方式</span>
        <span class="s2">"q"</span><span class="p">:</span><span class="s2">"0.014"</span><span class="p">,</span><span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span><span class="c1">// 订单数量</span>
        <span class="s2">"p"</span><span class="p">:</span><span class="s2">"9910"</span><span class="p">,</span><span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="c1">// 订单价格</span>
        <span class="s2">"ap"</span><span class="p">:</span><span class="s2">"9910"</span><span class="p">,</span><span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span><span class="c1">// 平均价格</span>
        <span class="s2">"X"</span><span class="p">:</span><span class="s2">"FILLED"</span><span class="p">,</span><span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="c1">// 订单状态</span>
        <span class="s2">"l"</span><span class="p">:</span><span class="s2">"0.014"</span><span class="p">,</span><span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span><span class="c1">// 订单最近成交量</span>
        <span class="s2">"z"</span><span class="p">:</span><span class="s2">"0.014"</span><span class="p">,</span><span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span><span class="c1">// 订单累计成交量</span>
        <span class="s2">"T"</span><span class="p">:</span><span class="mi">1568014460893</span><span class="p">,</span><span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span> <span class="err">&nbsp;</span>     <span class="c1">// 交易时间</span>

    <span class="p">}</span>

<span class="p">}</span>
</code></pre>
<p>推送全市场强平订单快照信息</p>

<p>每个symbol，1000ms内至多仅推送一条最近的强平订单作为快照</p>

<p><strong>Stream Name:</strong> <code>!forceOrder@arr</code></p>

<p><strong>Update Speed:</strong> 实时</p>
<h2 id="6ae7c2b506">有限档深度信息</h2>
<blockquote>
<p><strong>Payload:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">{</span>
  <span class="s2">"e"</span><span class="p">:</span> <span class="s2">"depthUpdate"</span><span class="p">,</span>           <span class="c1">// 事件类型</span>
  <span class="s2">"E"</span><span class="p">:</span> <span class="mi">1571889248277</span><span class="p">,</span>           <span class="c1">// 事件时间</span>
  <span class="s2">"T"</span><span class="p">:</span> <span class="mi">1571889248276</span><span class="p">,</span>           <span class="c1">// 交易时间</span>
  <span class="s2">"s"</span><span class="p">:</span> <span class="s2">"BTCUSDT"</span><span class="p">,</span>
  <span class="s2">"U"</span><span class="p">:</span> <span class="mi">390497796</span><span class="p">,</span>
  <span class="s2">"u"</span><span class="p">:</span> <span class="mi">390497878</span><span class="p">,</span>
  <span class="s2">"pu"</span><span class="p">:</span> <span class="mi">390497794</span><span class="p">,</span>
  <span class="s2">"b"</span><span class="p">:</span> <span class="p">[</span>                        <span class="c1">// 买方</span>
    <span class="p">[</span>
      <span class="s2">"7403.89"</span><span class="p">,</span>                <span class="c1">// 价格</span>
      <span class="s2">"0.002"</span>                   <span class="c1">// 数量</span>
    <span class="p">],</span>
    <span class="p">[</span>
      <span class="s2">"7403.90"</span><span class="p">,</span>
      <span class="s2">"3.906"</span>
    <span class="p">],</span>
    <span class="p">[</span>
      <span class="s2">"7404.00"</span><span class="p">,</span>
      <span class="s2">"1.428"</span>
    <span class="p">],</span>
    <span class="p">[</span>
      <span class="s2">"7404.85"</span><span class="p">,</span>
      <span class="s2">"5.239"</span>
    <span class="p">],</span>
    <span class="p">[</span>
      <span class="s2">"7405.43"</span><span class="p">,</span>
      <span class="s2">"2.562"</span>
    <span class="p">]</span>
  <span class="p">],</span>
  <span class="s2">"a"</span><span class="p">:</span> <span class="p">[</span>                        <span class="c1">// 卖方</span>
    <span class="p">[</span>
      <span class="s2">"7405.96"</span><span class="p">,</span>                <span class="c1">// 价格</span>
      <span class="s2">"3.340"</span>                   <span class="c1">// 数量</span>
    <span class="p">],</span>
    <span class="p">[</span>
      <span class="s2">"7406.63"</span><span class="p">,</span>
      <span class="s2">"4.525"</span>
    <span class="p">],</span>
    <span class="p">[</span>
      <span class="s2">"7407.08"</span><span class="p">,</span>
      <span class="s2">"2.475"</span>
    <span class="p">],</span>
    <span class="p">[</span>
      <span class="s2">"7407.15"</span><span class="p">,</span>
      <span class="s2">"4.800"</span>
    <span class="p">],</span>
    <span class="p">[</span>
      <span class="s2">"7407.20"</span><span class="p">,</span>
      <span class="s2">"0.175"</span>
    <span class="p">]</span>
  <span class="p">]</span>
<span class="p">}</span>
</code></pre>
<p>推送有限档深度信息。levels表示几档买卖单信息, 可选 5/10/20档</p>

<p><strong>Stream Names:</strong> <code>&lt;symbol&gt;@depth&lt;levels&gt;</code> 或 <code>&lt;symbol&gt;@depth&lt;levels&gt;@500ms</code> 或 <code>&lt;symbol&gt;@depth&lt;levels&gt;@100ms</code>.  </p>

<p><strong>Update Speed:</strong> 250ms 或 500ms 或 100ms</p>
<h2 id="1654ad2dd2">增量深度信息</h2>
<blockquote>
<p><strong>Payload:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">{</span>
  <span class="s2">"e"</span><span class="p">:</span> <span class="s2">"depthUpdate"</span><span class="p">,</span>   <span class="c1">// 事件类型</span>
  <span class="s2">"E"</span><span class="p">:</span> <span class="mi">123456789</span><span class="p">,</span>       <span class="c1">// 事件时间</span>
  <span class="s2">"T"</span><span class="p">:</span> <span class="mi">123456788</span><span class="p">,</span>       <span class="c1">// 撮合时间</span>
  <span class="s2">"s"</span><span class="p">:</span> <span class="s2">"BNBUSDT"</span><span class="p">,</span>       <span class="c1">// 交易对</span>
  <span class="s2">"U"</span><span class="p">:</span> <span class="mi">157</span><span class="p">,</span>             <span class="c1">// 从上次推送至今新增的第一个 update Id</span>
  <span class="s2">"u"</span><span class="p">:</span> <span class="mi">160</span><span class="p">,</span>             <span class="c1">// 从上次推送至今新增的最后一个 update Id</span>
  <span class="s2">"pu"</span><span class="p">:</span> <span class="mi">149</span><span class="p">,</span>            <span class="c1">// 上次推送的最后一个update Id(即上条消息的‘u’)</span>
  <span class="s2">"b"</span><span class="p">:</span> <span class="p">[</span>                <span class="c1">// 变动的买单深度</span>
    <span class="p">[</span>
      <span class="s2">"0.0024"</span><span class="p">,</span>         <span class="c1">// 价格</span>
      <span class="s2">"10"</span>              <span class="c1">// 数量</span>
    <span class="p">]</span>
  <span class="p">],</span>
  <span class="s2">"a"</span><span class="p">:</span> <span class="p">[</span>                <span class="c1">// 变动的卖单深度</span>
    <span class="p">[</span>
      <span class="s2">"0.0026"</span><span class="p">,</span>         <span class="c1">// 价格</span>
      <span class="s2">"100"</span>             <span class="c1">// 数量</span>
    <span class="p">]</span>
  <span class="p">]</span>
<span class="p">}</span>
</code></pre>
<p>orderbook的变化部分，推送间隔250毫秒,500毫秒，100毫秒(如有刷新)</p>

<p><strong>Stream 名称:</strong><br>
<code>&lt;symbol&gt;@depth</code> OR <code>&lt;symbol&gt;@depth@500ms</code> OR <code>&lt;symbol&gt;@depth@100ms</code></p>

<p><strong>Update Speed:</strong> 250ms 或 500ms 或 100ms</p>
<h2 id="orderbook">如何正确在本地维护一个orderbook副本</h2>
<ol>
<li>订阅 <strong>wss://fstream.binance.com/stream?streams=btcusdt@depth</strong></li>
<li>开始缓存收到的更新。同一个价位，后收到的更新覆盖前面的。</li>
<li>访问Rest接口 <strong>https://fapi.binance.com/fapi/v1/depth?symbol=BTCUSDT&amp;limit=1000</strong>获得一个1000档的深度快照</li>
<li>将目前缓存到的信息中<code>u</code>&lt; 步骤3中获取到的快照中的<code>lastUpdateId</code>的部分丢弃(丢弃更早的信息，已经过期)。</li>
<li>将深度快照中的内容更新到本地orderbook副本中，并从websocket接收到的第一个<code>U</code> &lt;= <code>lastUpdateId</code> <strong>且</strong> <code>u</code> &gt;= <code>lastUpdateId</code> 的event开始继续更新本地副本。</li>
<li>每一个新event的<code>pu</code>应该等于上一个event的<code>u</code>，否则可能出现了丢包，请从step3重新进行初始化。</li>
<li>每一个event中的挂单量代表这个价格目前的挂单量<strong>绝对值</strong>，而不是相对变化。</li>
<li>如果某个价格对应的挂单量为0，表示该价位的挂单已经撤单或者被吃，应该移除这个价位。</li>
</ol>
<h2 id="3b7da71d4b">杠杆代币信息更新</h2>
<blockquote>
<p><strong>Payload:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">{</span>
    <span class="s2">"e"</span><span class="p">:</span><span class="s2">"nav"</span><span class="p">,</span>      <span class="c1">// 事件类型</span>
    <span class="s2">"E"</span><span class="p">:</span><span class="mi">1600245286355</span><span class="p">,</span>  <span class="c1">// 事件时间</span>
    <span class="s2">"s"</span><span class="p">:</span><span class="s2">"TRXDOWN"</span><span class="p">,</span>  <span class="c1">// 杠杆代币</span>
    <span class="s2">"m"</span><span class="p">:</span><span class="mf">74164.75496502663</span><span class="p">,</span>  <span class="c1">//已发行代币</span>
    <span class="s2">"b"</span><span class="p">:[</span>   <span class="c1">// 篮子</span>
        <span class="p">{</span>
            <span class="s2">"s"</span><span class="p">:</span><span class="s2">"TRXUSDT"</span><span class="p">,</span>  <span class="c1">// 合约交易对</span>
            <span class="s2">"n"</span><span class="p">:</span><span class="o">-</span><span class="mi">87988261</span>       <span class="c1">// 持仓数量</span>
        <span class="p">}</span>
    <span class="p">],</span>
    <span class="s2">"n"</span><span class="p">:</span><span class="mf">14.78454447</span><span class="p">,</span>        <span class="c1">// 净值</span>
    <span class="s2">"l"</span><span class="p">:</span><span class="mf">2.1786579638117898</span><span class="p">,</span>      <span class="c1">// 真实杠杆</span>
    <span class="s2">"t"</span><span class="p">:</span><span class="mi">3</span><span class="p">,</span>      <span class="c1">// 目标杠杆</span>
    <span class="s2">"f"</span><span class="p">:</span><span class="o">-</span><span class="mf">0.0048925</span>  <span class="c1">// 资金费率</span>
<span class="p">}</span>
</code></pre>
<p><strong>Stream Name:</strong> <code>&lt;tokenName&gt;@tokenNav</code>    </p>

<ul>
<li><strong>注意:</strong> tokenName 请使用<strong>大写字母</strong>，例如"TRXDOWN"</li>
</ul>
<h2 id="k-8">杠杆代币净值K线</h2>
<blockquote>
<p><strong>Payload:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">{</span>
    <span class="s2">"e"</span><span class="p">:</span><span class="s2">"kline"</span><span class="p">,</span>    <span class="c1">// 事件类型</span>
    <span class="s2">"E"</span><span class="p">:</span><span class="mi">1600243159447</span><span class="p">,</span>  <span class="c1">// 事件时间</span>
    <span class="s2">"s"</span><span class="p">:</span><span class="s2">"TRXDOWN"</span><span class="p">,</span>  <span class="c1">// 杠杆代币</span>
    <span class="s2">"k"</span><span class="p">:{</span>
        <span class="s2">"t"</span><span class="p">:</span><span class="mi">1600243140000</span><span class="p">,</span>  <span class="c1">// 这根K线的起始时间</span>
        <span class="s2">"T"</span><span class="p">:</span><span class="mi">1600243199999</span><span class="p">,</span>  <span class="c1">// 这根K线的结束时间</span>
        <span class="s2">"s"</span><span class="p">:</span><span class="s2">"TRXDOWN"</span><span class="p">,</span>  <span class="c1">// 杠杆代币</span>
        <span class="s2">"i"</span><span class="p">:</span><span class="s2">"1m"</span><span class="p">,</span>   <span class="c1">// K线间隔</span>
        <span class="s2">"f"</span><span class="p">:</span><span class="mi">1600243140484</span><span class="p">,</span>  <span class="c1">//这根K线期间第一笔净值更新时间</span>
        <span class="s2">"L"</span><span class="p">:</span><span class="mi">1600243159424</span><span class="p">,</span>  <span class="c1">//这根K线期间末一笔净值更新时间</span>
        <span class="s2">"o"</span><span class="p">:</span><span class="s2">"14.56800297"</span><span class="p">,</span>  <span class="c1">// 这根K线期间第一笔净值</span>
        <span class="s2">"c"</span><span class="p">:</span><span class="s2">"14.59766270"</span><span class="p">,</span>  <span class="c1">// 这根K线期间末一笔净值</span>
        <span class="s2">"h"</span><span class="p">:</span><span class="s2">"14.63325437"</span><span class="p">,</span>  <span class="c1">// 这根K线期间最高净值</span>
        <span class="s2">"l"</span><span class="p">:</span><span class="s2">"14.56207102"</span><span class="p">,</span>  <span class="c1">// 这根K线期间最低净值</span>
        <span class="s2">"v"</span><span class="p">:</span><span class="s2">"2.22524220"</span><span class="p">,</span>   <span class="c1">// 真实杠杆倍数</span>
        <span class="s2">"n"</span><span class="p">:</span><span class="mi">33</span><span class="p">,</span> <span class="c1">// 这根K线期间更新的净值次数</span>
        <span class="s2">"x"</span><span class="p">:</span><span class="kc">false</span><span class="p">,</span>  <span class="c1">// 忽略此参数</span>
        <span class="s2">"q"</span><span class="p">:</span><span class="s2">"0"</span><span class="p">,</span>    <span class="c1">// 忽略此参数</span>
        <span class="s2">"V"</span><span class="p">:</span><span class="s2">"73.42663923"</span><span class="p">,</span>  <span class="c1">// 忽略此参数</span>
        <span class="s2">"Q"</span><span class="p">:</span><span class="s2">"0"</span><span class="p">,</span>    <span class="c1">// 忽略此参数</span>
        <span class="s2">"B"</span><span class="p">:</span><span class="s2">"0"</span> <span class="c1">// 忽略此参数</span>
   <span class="p">}</span>
<span class="p">}</span>
</code></pre>
<p><strong>Stream Name:</strong> <code>&lt;tokenName&gt;@nav_Kline_&lt;interval&gt;</code>    </p>

<ul>
<li><strong>注意:</strong> tokenName 请使用<strong>大写字母</strong>，例如"TRXDOWN"</li>
</ul>

<p><strong>Update Speed:</strong> 300ms</p>

<p><strong>K线图间隔参数:</strong></p>

<p>m -&gt; 分钟; h -&gt; 小时; d -&gt; 天; w -&gt; 周; M -&gt; 月</p>

<ul>
<li>1m</li>
<li>3m</li>
<li>5m</li>
<li>15m</li>
<li>30m</li>
<li>1h</li>
<li>2h</li>
<li>4h</li>
<li>6h</li>
<li>8h</li>
<li>12h</li>
<li>1d</li>
<li>3d</li>
<li>1w</li>
<li>1M</li>
</ul>
<h2 id="f55afdefd4">综合指数交易对信息流</h2>
<blockquote>
<p><strong>Payload:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">{</span>
  <span class="s2">"e"</span><span class="p">:</span><span class="s2">"compositeIndex"</span><span class="p">,</span>     <span class="c1">// 事件类型</span>
  <span class="s2">"E"</span><span class="p">:</span><span class="mi">1602310596000</span><span class="p">,</span>        <span class="c1">// 事件事件</span>
  <span class="s2">"s"</span><span class="p">:</span><span class="s2">"DEFIUSDT"</span><span class="p">,</span>           <span class="c1">// 交易对</span>
  <span class="s2">"p"</span><span class="p">:</span><span class="s2">"554.41604065"</span><span class="p">,</span>       <span class="c1">// 价格</span>
  <span class="s2">"c"</span><span class="p">:[</span>                 <span class="c1">// 成分信息</span>
    <span class="p">{</span>
        <span class="s2">"b"</span><span class="p">:</span><span class="s2">"BAL"</span><span class="p">,</span>          <span class="c1">//基础资产</span>
        <span class="s2">"w"</span><span class="p">:</span><span class="s2">"1.35038833"</span><span class="p">,</span>   <span class="c1">// 权重(数量)</span>
        <span class="s2">"W"</span><span class="p">:</span><span class="s2">"0.03957100"</span>    <span class="c1">// 权重(比例)</span>
    <span class="p">},</span>
    <span class="p">{</span>
        <span class="s2">"b"</span><span class="p">:</span><span class="s2">"BAND"</span><span class="p">,</span>
        <span class="s2">"w"</span><span class="p">:</span><span class="s2">"3.53782729"</span><span class="p">,</span>
        <span class="s2">"W"</span><span class="p">:</span><span class="s2">"0.03935200"</span>
    <span class="p">}</span>
  <span class="p">]</span>
<span class="p">}</span>
</code></pre>
<p>获取交易对为综合指数的基础成分信息。
推送间隔1000毫秒(如有刷新)</p>

<p><strong>Stream Name:</strong> <code>&lt;symbol&gt;@compositeIndex</code></p>

<p><strong>Update Speed:</strong> 1000ms</p>
<h1 id="93d49cc2e5">账户和交易接口</h1>
<aside class="warning">
考虑到剧烈行情下, RESTful接口可能存在查询延迟，我们强烈建议您优先从Websocket user data stream推送的消息来获取订单，成交，仓位等信息。
</aside>
<h2 id="1045de04a1">划转</h2>
<p>执行现货账户与合约账户之间的划转, <a href="https://binance-docs.github.io/apidocs/spot/cn/#futures-5">详情请见这里</a>.</p>
<h2 id="87a7130ac5">获取划转历史</h2>
<p>获取现货账户与合约账户之间的资金划转历史记录,<a href="https://binance-docs.github.io/apidocs/spot/cn/#user_data-51">详情请见这里</a>.</p>
<h2 id="trade">更改持仓模式(TRADE)</h2>
<blockquote>
<p><strong>响应:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">{</span>
    <span class="s2">"code"</span><span class="p">:</span> <span class="mi">200</span><span class="p">,</span>
    <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"success"</span>
<span class="p">}</span>
</code></pre>
<p><code>
POST /fapi/v1/positionSide/dual (HMAC SHA256)
</code></p>

<p>变换用户在 <strong><em>所有symbol</em></strong> 合约上的持仓模式：双向持仓或单向持仓。   </p>

<p><strong>权重:</strong>
1</p>

<p><strong>参数:</strong></p>

<table><thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必需</th>
<th>描述</th>
</tr>
</thead><tbody>
<tr>
<td>dualSidePosition</td>
<td>STRING</td>
<td>YES</td>
<td>"true": 双向持仓模式；"false": 单向持仓模式</td>
</tr>
<tr>
<td>recvWindow</td>
<td>LONG</td>
<td>NO</td>
<td></td>
</tr>
<tr>
<td>timestamp</td>
<td>LONG</td>
<td>YES</td>
<td></td>
</tr>
</tbody></table>
<h2 id="user_data">查询持仓模式(USER_DATA)</h2>
<blockquote>
<p><strong>响应:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">{</span>
    <span class="s2">"dualSidePosition"</span><span class="p">:</span> <span class="kc">true</span> <span class="c1">// "true": 双向持仓模式；"false": 单向持仓模式</span>
<span class="p">}</span>
</code></pre>
<p><code>
GET /fapi/v1/positionSide/dual (HMAC SHA256)
</code></p>

<p>查询用户目前在 <strong><em>所有symbol</em></strong> 合约上的持仓模式：双向持仓或单向持仓。     </p>

<p><strong>权重:</strong>
30</p>

<p><strong>参数:</strong></p>

<table><thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必需</th>
<th>描述</th>
</tr>
</thead><tbody>
<tr>
<td>recvWindow</td>
<td>LONG</td>
<td>NO</td>
<td></td>
</tr>
<tr>
<td>timestamp</td>
<td>LONG</td>
<td>YES</td>
<td></td>
</tr>
</tbody></table>
<h2 id="trade-2">更改联合保证金模式(TRADE)</h2>
<blockquote>
<p><strong>响应:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">{</span>
    <span class="s2">"code"</span><span class="p">:</span> <span class="mi">200</span><span class="p">,</span>
    <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"success"</span>
<span class="p">}</span>
</code></pre>
<p><code>
POST /fapi/v1/multiAssetsMargin (HMAC SHA256)
</code></p>

<p>变换用户在 <strong><em>所有symbol</em></strong> 合约上的联合保证金模式：开启或关闭联合保证金模式。   </p>

<p><strong>权重:</strong>
1</p>

<p><strong>参数:</strong></p>

<table><thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必需</th>
<th>描述</th>
</tr>
</thead><tbody>
<tr>
<td>multiAssetsMargin</td>
<td>STRING</td>
<td>YES</td>
<td>"true": 联合保证金模式开启；"false": 联合保证金模式关闭</td>
</tr>
<tr>
<td>recvWindow</td>
<td>LONG</td>
<td>NO</td>
<td></td>
</tr>
<tr>
<td>timestamp</td>
<td>LONG</td>
<td>YES</td>
<td></td>
</tr>
</tbody></table>
<h2 id="user_data-2">查询联合保证金模式(USER_DATA)</h2>
<blockquote>
<p><strong>响应:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">{</span>
    <span class="s2">"multiAssetsMargin"</span><span class="p">:</span> <span class="kc">true</span> <span class="c1">// "true": 联合保证金模式开启；"false": 联合保证金模式关闭</span>
<span class="p">}</span>
</code></pre>
<p><code>
GET /fapi/v1/multiAssetsMargin (HMAC SHA256)
</code></p>

<p>查询用户目前在 <strong><em>所有symbol</em></strong> 合约上的联合保证金模式。      </p>

<p><strong>权重:</strong>
30</p>

<p><strong>参数:</strong></p>

<table><thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必需</th>
<th>描述</th>
</tr>
</thead><tbody>
<tr>
<td>recvWindow</td>
<td>LONG</td>
<td>NO</td>
<td></td>
</tr>
<tr>
<td>timestamp</td>
<td>LONG</td>
<td>YES</td>
<td></td>
</tr>
</tbody></table>
<h2 id="trade-3">下单 (TRADE)</h2>
<blockquote>
<p><strong>响应:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">{</span>
    <span class="s2">"clientOrderId"</span><span class="p">:</span> <span class="s2">"testOrder"</span><span class="p">,</span> <span class="c1">// 用户自定义的订单号</span>
    <span class="s2">"cumQty"</span><span class="p">:</span> <span class="s2">"0"</span><span class="p">,</span>
    <span class="s2">"cumQuote"</span><span class="p">:</span> <span class="s2">"0"</span><span class="p">,</span> <span class="c1">// 成交金额</span>
    <span class="s2">"executedQty"</span><span class="p">:</span> <span class="s2">"0"</span><span class="p">,</span> <span class="c1">// 成交量</span>
    <span class="s2">"orderId"</span><span class="p">:</span> <span class="mi">22542179</span><span class="p">,</span> <span class="c1">// 系统订单号</span>
    <span class="s2">"avgPrice"</span><span class="p">:</span> <span class="s2">"0.00000"</span><span class="p">,</span>  <span class="c1">// 平均成交价</span>
    <span class="s2">"origQty"</span><span class="p">:</span> <span class="s2">"10"</span><span class="p">,</span> <span class="c1">// 原始委托数量</span>
    <span class="s2">"price"</span><span class="p">:</span> <span class="s2">"0"</span><span class="p">,</span> <span class="c1">// 委托价格</span>
    <span class="s2">"reduceOnly"</span><span class="p">:</span> <span class="kc">false</span><span class="p">,</span> <span class="c1">// 仅减仓</span>
    <span class="s2">"side"</span><span class="p">:</span> <span class="s2">"SELL"</span><span class="p">,</span> <span class="c1">// 买卖方向</span>
    <span class="s2">"positionSide"</span><span class="p">:</span> <span class="s2">"SHORT"</span><span class="p">,</span> <span class="c1">// 持仓方向</span>
    <span class="s2">"status"</span><span class="p">:</span> <span class="s2">"NEW"</span><span class="p">,</span> <span class="c1">// 订单状态</span>
    <span class="s2">"stopPrice"</span><span class="p">:</span> <span class="s2">"0"</span><span class="p">,</span> <span class="c1">// 触发价，对`TRAILING_STOP_MARKET`无效</span>
    <span class="s2">"closePosition"</span><span class="p">:</span> <span class="kc">false</span><span class="p">,</span>   <span class="c1">// 是否条件全平仓</span>
    <span class="s2">"symbol"</span><span class="p">:</span> <span class="s2">"BTCUSDT"</span><span class="p">,</span> <span class="c1">// 交易对</span>
    <span class="s2">"timeInForce"</span><span class="p">:</span> <span class="s2">"GTC"</span><span class="p">,</span> <span class="c1">// 有效方法</span>
    <span class="s2">"type"</span><span class="p">:</span> <span class="s2">"TRAILING_STOP_MARKET"</span><span class="p">,</span> <span class="c1">// 订单类型</span>
    <span class="s2">"origType"</span><span class="p">:</span> <span class="s2">"TRAILING_STOP_MARKET"</span><span class="p">,</span>  <span class="c1">// 触发前订单类型</span>
    <span class="s2">"activatePrice"</span><span class="p">:</span> <span class="s2">"9020"</span><span class="p">,</span> <span class="c1">// 跟踪止损激活价格, 仅`TRAILING_STOP_MARKET` 订单返回此字段</span>
    <span class="s2">"priceRate"</span><span class="p">:</span> <span class="s2">"0.3"</span><span class="p">,</span> <span class="c1">// 跟踪止损回调比例, 仅`TRAILING_STOP_MARKET` 订单返回此字段</span>
    <span class="s2">"updateTime"</span><span class="p">:</span> <span class="mi">1566818724722</span><span class="p">,</span> <span class="c1">// 更新时间</span>
    <span class="s2">"workingType"</span><span class="p">:</span> <span class="s2">"CONTRACT_PRICE"</span><span class="p">,</span> <span class="c1">// 条件价格触发类型</span>
    <span class="s2">"priceProtect"</span><span class="p">:</span> <span class="kc">false</span>            <span class="c1">// 是否开启条件单触发保护</span>
<span class="p">}</span>
</code></pre>
<p><code>
POST /fapi/v1/order  (HMAC SHA256)
</code></p>

<p><strong>权重:</strong>
1</p>

<p><strong>参数:</strong></p>

<table><thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必需</th>
<th>描述</th>
</tr>
</thead><tbody>
<tr>
<td>symbol</td>
<td>STRING</td>
<td>YES</td>
<td>交易对</td>
</tr>
<tr>
<td>side</td>
<td>ENUM</td>
<td>YES</td>
<td>买卖方向 <code>SELL</code>, <code>BUY</code></td>
</tr>
<tr>
<td>positionSide</td>
<td>ENUM</td>
<td>NO</td>
<td>持仓方向，单向持仓模式下非必填，默认且仅可填<code>BOTH</code>;在双向持仓模式下必填,且仅可选择 <code>LONG</code> 或 <code>SHORT</code></td>
</tr>
<tr>
<td>type</td>
<td>ENUM</td>
<td>YES</td>
<td>订单类型 <code>LIMIT</code>, <code>MARKET</code>, <code>STOP</code>, <code>TAKE_PROFIT</code>, <code>STOP_MARKET</code>, <code>TAKE_PROFIT_MARKET</code>, <code>TRAILING_STOP_MARKET</code></td>
</tr>
<tr>
<td>reduceOnly</td>
<td>STRING</td>
<td>NO</td>
<td><code>true</code>, <code>false</code>; 非双开模式下默认<code>false</code>；双开模式下不接受此参数； 使用<code>closePosition</code>不支持此参数。</td>
</tr>
<tr>
<td>quantity</td>
<td>DECIMAL</td>
<td>NO</td>
<td>下单数量,使用<code>closePosition</code>不支持此参数。</td>
</tr>
<tr>
<td>price</td>
<td>DECIMAL</td>
<td>NO</td>
<td>委托价格</td>
</tr>
<tr>
<td>newClientOrderId</td>
<td>STRING</td>
<td>NO</td>
<td>用户自定义的订单号，不可以重复出现在挂单中。如空缺系统会自动赋值。必须满足正则规则 <code>^[\.A-Z\:/a-z0-9_-]{1,36}$</code></td>
</tr>
<tr>
<td>stopPrice</td>
<td>DECIMAL</td>
<td>NO</td>
<td>触发价, 仅 <code>STOP</code>, <code>STOP_MARKET</code>, <code>TAKE_PROFIT</code>, <code>TAKE_PROFIT_MARKET</code> 需要此参数</td>
</tr>
<tr>
<td>closePosition</td>
<td>STRING</td>
<td>NO</td>
<td><code>true</code>, <code>false</code>；触发后全部平仓，仅支持<code>STOP_MARKET</code>和<code>TAKE_PROFIT_MARKET</code>；不与<code>quantity</code>合用；自带只平仓效果，不与<code>reduceOnly</code> 合用</td>
</tr>
<tr>
<td>activationPrice</td>
<td>DECIMAL</td>
<td>NO</td>
<td>追踪止损激活价格，仅<code>TRAILING_STOP_MARKET</code> 需要此参数, 默认为下单当前市场价格(支持不同<code>workingType</code>)</td>
</tr>
<tr>
<td>callbackRate</td>
<td>DECIMAL</td>
<td>NO</td>
<td>追踪止损回调比例，可取值范围[0.1, 5],其中 1代表1% ,仅<code>TRAILING_STOP_MARKET</code> 需要此参数</td>
</tr>
<tr>
<td>timeInForce</td>
<td>ENUM</td>
<td>NO</td>
<td>有效方法</td>
</tr>
<tr>
<td>workingType</td>
<td>ENUM</td>
<td>NO</td>
<td>stopPrice 触发类型: <code>MARK_PRICE</code>(标记价格), <code>CONTRACT_PRICE</code>(合约最新价). 默认 <code>CONTRACT_PRICE</code></td>
</tr>
<tr>
<td>priceProtect</td>
<td>STRING</td>
<td>NO</td>
<td>条件单触发保护："TRUE","FALSE", 默认"FALSE". 仅 <code>STOP</code>, <code>STOP_MARKET</code>, <code>TAKE_PROFIT</code>, <code>TAKE_PROFIT_MARKET</code> 需要此参数</td>
</tr>
<tr>
<td>newOrderRespType</td>
<td>ENUM</td>
<td>NO</td>
<td>"ACK", "RESULT", 默认 "ACK"</td>
</tr>
<tr>
<td>recvWindow</td>
<td>LONG</td>
<td>NO</td>
<td></td>
</tr>
<tr>
<td>timestamp</td>
<td>LONG</td>
<td>YES</td>
<td></td>
</tr>
</tbody></table>

<p>根据 order <code>type</code>的不同，某些参数强制要求，具体如下:</p>

<table><thead>
<tr>
<th>Type</th>
<th>强制要求的参数</th>
</tr>
</thead><tbody>
<tr>
<td><code>LIMIT</code></td>
<td><code>timeInForce</code>, <code>quantity</code>, <code>price</code></td>
</tr>
<tr>
<td><code>MARKET</code></td>
<td><code>quantity</code></td>
</tr>
<tr>
<td><code>STOP</code>, <code>TAKE_PROFIT</code></td>
<td><code>quantity</code>,  <code>price</code>, <code>stopPrice</code></td>
</tr>
<tr>
<td><code>STOP_MARKET</code>, <code>TAKE_PROFIT_MARKET</code></td>
<td><code>stopPrice</code></td>
</tr>
<tr>
<td><code>TRAILING_STOP_MARKET</code></td>
<td><code>callbackRate</code></td>
</tr>
</tbody></table>

<ul>
<li><p>条件单的触发必须:</p>

<ul>
<li>如果订单参数<code>priceProtect</code>为true:

<ul>
<li>达到触发价时，<code>MARK_PRICE</code>(标记价格)与<code>CONTRACT_PRICE</code>(合约最新价)之间的价差不能超过改symbol触发保护阈值</li>
<li>触发保护阈值请参考接口<code>GET /fapi/v1/exchangeInfo</code> 返回内容相应symbol中"triggerProtect"字段</li>
</ul></li>
<li><code>STOP</code>, <code>STOP_MARKET</code> 止损单:

<ul>
<li>买入: 最新合约价格/标记价格高于等于触发价<code>stopPrice</code></li>
<li>卖出: 最新合约价格/标记价格低于等于触发价<code>stopPrice</code></li>
</ul></li>
<li><code>TAKE_PROFIT</code>, <code>TAKE_PROFIT_MARKET</code> 止盈单:

<ul>
<li>买入: 最新合约价格/标记价格低于等于触发价<code>stopPrice</code></li>
<li>卖出: 最新合约价格/标记价格高于等于触发价<code>stopPrice</code></li>
</ul></li>
<li><code>TRAILING_STOP_MARKET</code> 跟踪止损单:

<ul>
<li>买入: 当合约价格/标记价格区间最低价格低于激活价格<code>activationPrice</code>,且最新合约价格/标记价高于等于最低价设定回调幅度。</li>
<li>卖出: 当合约价格/标记价格区间最高价格高于激活价格<code>activationPrice</code>,且最新合约价格/标记价低于等于最高价设定回调幅度。</li>
</ul></li>
</ul></li>
<li><p><code>TRAILING_STOP_MARKET</code> 跟踪止损单如果遇到报错 <code>{"code": -2021, "msg": "Order would immediately trigger."}</code><br>
表示订单不满足以下条件:</p>

<ul>
<li>买入: 指定的<code>activationPrice</code> 必须小于 latest price</li>
<li>卖出: 指定的<code>activationPrice</code> 必须大于 latest price</li>
</ul></li>
<li><p><code>newOrderRespType</code> 如果传 <code>RESULT</code>:</p>

<ul>
<li><code>MARKET</code> 订单将直接返回成交结果；</li>
<li>配合使用特殊 <code>timeInForce</code> 的 <code>LIMIT</code> 订单将直接返回成交或过期拒绝结果。</li>
</ul></li>
<li><p><code>STOP_MARKET</code>, <code>TAKE_PROFIT_MARKET</code> 配合 <code>closePosition</code>=<code>true</code>:</p>

<ul>
<li>条件单触发依照上述条件单触发逻辑</li>
<li>条件触发后，平掉当时持有所有多头仓位(若为卖单)或当时持有所有空头仓位(若为买单)</li>
<li>不支持 <code>quantity</code> 参数</li>
<li>自带只平仓属性，不支持<code>reduceOnly</code>参数</li>
<li>双开模式下,<code>LONG</code>方向上不支持<code>BUY</code>; <code>SHORT</code> 方向上不支持<code>SELL</code></li>
</ul></li>
</ul>
<h2 id="trade-4">测试下单接口 (TRADE)</h2>
<blockquote>
<p><strong>响应:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="err">字段与下单接口一致，但均为无效值</span>
</code></pre>
<p><code>
POST /fapi/v1/order/test (HMAC SHA256)
</code></p>

<p>用于测试订单请求，但不会提交到撮合引擎</p>

<p><strong>权重:</strong>
1</p>

<p><strong>参数:</strong></p>

<p>参考 <code>POST /fapi/v1/order</code></p>
<h2 id="trade-5">批量下单 (TRADE)</h2>
<blockquote>
<p><strong>响应:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">[</span>
    <span class="p">{</span>
        <span class="s2">"clientOrderId"</span><span class="p">:</span> <span class="s2">"testOrder"</span><span class="p">,</span> <span class="c1">// 用户自定义的订单号</span>
        <span class="s2">"cumQty"</span><span class="p">:</span> <span class="s2">"0"</span><span class="p">,</span>
        <span class="s2">"cumQuote"</span><span class="p">:</span> <span class="s2">"0"</span><span class="p">,</span> <span class="c1">// 成交金额</span>
        <span class="s2">"executedQty"</span><span class="p">:</span> <span class="s2">"0"</span><span class="p">,</span> <span class="c1">// 成交量</span>
        <span class="s2">"orderId"</span><span class="p">:</span> <span class="mi">22542179</span><span class="p">,</span> <span class="c1">// 系统订单号</span>
        <span class="s2">"avgPrice"</span><span class="p">:</span> <span class="s2">"0.00000"</span><span class="p">,</span>  <span class="c1">// 平均成交价</span>
        <span class="s2">"origQty"</span><span class="p">:</span> <span class="s2">"10"</span><span class="p">,</span> <span class="c1">// 原始委托数量</span>
        <span class="s2">"price"</span><span class="p">:</span> <span class="s2">"0"</span><span class="p">,</span> <span class="c1">// 委托价格</span>
        <span class="s2">"reduceOnly"</span><span class="p">:</span> <span class="kc">false</span><span class="p">,</span> <span class="c1">// 仅减仓</span>
        <span class="s2">"side"</span><span class="p">:</span> <span class="s2">"SELL"</span><span class="p">,</span> <span class="c1">// 买卖方向</span>
        <span class="s2">"positionSide"</span><span class="p">:</span> <span class="s2">"SHORT"</span><span class="p">,</span> <span class="c1">// 持仓方向</span>
        <span class="s2">"status"</span><span class="p">:</span> <span class="s2">"NEW"</span><span class="p">,</span> <span class="c1">// 订单状态</span>
        <span class="s2">"stopPrice"</span><span class="p">:</span> <span class="s2">"0"</span><span class="p">,</span> <span class="c1">// 触发价，对`TRAILING_STOP_MARKET`无效</span>
        <span class="s2">"closePosition"</span><span class="p">:</span> <span class="kc">false</span><span class="p">,</span>   <span class="c1">// 是否条件全平仓</span>
        <span class="s2">"symbol"</span><span class="p">:</span> <span class="s2">"BTCUSDT"</span><span class="p">,</span> <span class="c1">// 交易对</span>
        <span class="s2">"timeInForce"</span><span class="p">:</span> <span class="s2">"GTC"</span><span class="p">,</span> <span class="c1">// 有效方法</span>
        <span class="s2">"type"</span><span class="p">:</span> <span class="s2">"TRAILING_STOP_MARKET"</span><span class="p">,</span> <span class="c1">// 订单类型</span>
        <span class="s2">"origType"</span><span class="p">:</span> <span class="s2">"TRAILING_STOP_MARKET"</span><span class="p">,</span>  <span class="c1">// 触发前订单类型</span>
        <span class="s2">"activatePrice"</span><span class="p">:</span> <span class="s2">"9020"</span><span class="p">,</span> <span class="c1">// 跟踪止损激活价格, 仅`TRAILING_STOP_MARKET` 订单返回此字段</span>
        <span class="s2">"priceRate"</span><span class="p">:</span> <span class="s2">"0.3"</span><span class="p">,</span> <span class="c1">// 跟踪止损回调比例, 仅`TRAILING_STOP_MARKET` 订单返回此字段</span>
        <span class="s2">"updateTime"</span><span class="p">:</span> <span class="mi">1566818724722</span><span class="p">,</span> <span class="c1">// 更新时间</span>
        <span class="s2">"workingType"</span><span class="p">:</span> <span class="s2">"CONTRACT_PRICE"</span><span class="p">,</span> <span class="c1">// 条件价格触发类型</span>
        <span class="s2">"priceProtect"</span><span class="p">:</span> <span class="kc">false</span>            <span class="c1">// 是否开启条件单触发保护</span>
    <span class="p">},</span>
    <span class="p">{</span>
        <span class="s2">"code"</span><span class="p">:</span> <span class="o">-</span><span class="mi">2022</span><span class="p">,</span> 
        <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"ReduceOnly Order is rejected."</span>
    <span class="p">}</span>
<span class="p">]</span>
</code></pre>
<p><code>
POST /fapi/v1/batchOrders  (HMAC SHA256)
</code></p>

<p><strong>权重:</strong>
5</p>

<p><strong>参数:</strong></p>

<table><thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必需</th>
<th>描述</th>
</tr>
</thead><tbody>
<tr>
<td>batchOrders</td>
<td>list<json></json></td>
<td>YES</td>
<td>订单列表，最多支持5个订单</td>
</tr>
<tr>
<td>recvWindow</td>
<td>LONG</td>
<td>NO</td>
<td></td>
</tr>
<tr>
<td>timestamp</td>
<td>LONG</td>
<td>YES</td>
<td></td>
</tr>
</tbody></table>

<p><strong>其中<code>batchOrders</code>应以list of JSON格式填写订单参数</strong></p>

<table><thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必需</th>
<th>描述</th>
</tr>
</thead><tbody>
<tr>
<td>symbol</td>
<td>STRING</td>
<td>YES</td>
<td>交易对</td>
</tr>
<tr>
<td>side</td>
<td>ENUM</td>
<td>YES</td>
<td>买卖方向 <code>SELL</code>, <code>BUY</code></td>
</tr>
<tr>
<td>positionSide</td>
<td>ENUM</td>
<td>NO</td>
<td>持仓方向，单向持仓模式下非必填，默认且仅可填<code>BOTH</code>;在双向持仓模式下必填,且仅可选择 <code>LONG</code> 或 <code>SHORT</code></td>
</tr>
<tr>
<td>type</td>
<td>ENUM</td>
<td>YES</td>
<td>订单类型 <code>LIMIT</code>, <code>MARKET</code>, <code>STOP</code>, <code>TAKE_PROFIT</code>, <code>STOP_MARKET</code>, <code>TAKE_PROFIT_MARKET</code>, <code>TRAILING_STOP_MARKET</code></td>
</tr>
<tr>
<td>reduceOnly</td>
<td>STRING</td>
<td>NO</td>
<td><code>true</code>, <code>false</code>; 非双开模式下默认<code>false</code>；双开模式下不接受此参数。</td>
</tr>
<tr>
<td>quantity</td>
<td>DECIMAL</td>
<td>YES</td>
<td>下单数量</td>
</tr>
<tr>
<td>price</td>
<td>DECIMAL</td>
<td>NO</td>
<td>委托价格</td>
</tr>
<tr>
<td>newClientOrderId</td>
<td>STRING</td>
<td>NO</td>
<td>用户自定义的订单号，不可以重复出现在挂单中。如空缺系统会自动赋值. 必须满足正则规则 <code>^[\.A-Z\:/a-z0-9_-]{1,36}$</code></td>
</tr>
<tr>
<td>stopPrice</td>
<td>DECIMAL</td>
<td>NO</td>
<td>触发价, 仅 <code>STOP</code>, <code>STOP_MARKET</code>, <code>TAKE_PROFIT</code>, <code>TAKE_PROFIT_MARKET</code> 需要此参数</td>
</tr>
<tr>
<td>activationPrice</td>
<td>DECIMAL</td>
<td>NO</td>
<td>追踪止损激活价格，仅<code>TRAILING_STOP_MARKET</code> 需要此参数, 默认为下单当前市场价格(支持不同<code>workingType</code>)</td>
</tr>
<tr>
<td>callbackRate</td>
<td>DECIMAL</td>
<td>NO</td>
<td>追踪止损回调比例，可取值范围[0.1, 4],其中 1代表1% ,仅<code>TRAILING_STOP_MARKET</code> 需要此参数</td>
</tr>
<tr>
<td>timeInForce</td>
<td>ENUM</td>
<td>NO</td>
<td>有效方法</td>
</tr>
<tr>
<td>workingType</td>
<td>ENUM</td>
<td>NO</td>
<td>stopPrice 触发类型: <code>MARK_PRICE</code>(标记价格), <code>CONTRACT_PRICE</code>(合约最新价). 默认 <code>CONTRACT_PRICE</code></td>
</tr>
<tr>
<td>priceProtect</td>
<td>STRING</td>
<td>NO</td>
<td>条件单触发保护："TRUE","FALSE", 默认"FALSE". 仅 <code>STOP</code>, <code>STOP_MARKET</code>, <code>TAKE_PROFIT</code>, <code>TAKE_PROFIT_MARKET</code> 需要此参数</td>
</tr>
<tr>
<td>newOrderRespType</td>
<td>ENUM</td>
<td>NO</td>
<td>"ACK", "RESULT", 默认 "ACK"</td>
</tr>
</tbody></table>

<ul>
<li>具体订单条件规则，与普通下单一致</li>
<li>批量下单采取并发处理，不保证订单撮合顺序</li>
<li>批量下单的返回内容顺序，与订单列表顺序一致</li>
</ul>
<h2 id="user_data-3">查询订单 (USER_DATA)</h2>
<blockquote>
<p><strong>响应:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">{</span>
    <span class="s2">"avgPrice"</span><span class="p">:</span> <span class="s2">"0.00000"</span><span class="p">,</span>              <span class="c1">// 平均成交价</span>
    <span class="s2">"clientOrderId"</span><span class="p">:</span> <span class="s2">"abc"</span><span class="p">,</span>             <span class="c1">// 用户自定义的订单号</span>
    <span class="s2">"cumQuote"</span><span class="p">:</span> <span class="s2">"0"</span><span class="p">,</span>                    <span class="c1">// 成交金额</span>
    <span class="s2">"executedQty"</span><span class="p">:</span> <span class="s2">"0"</span><span class="p">,</span>                 <span class="c1">// 成交量</span>
    <span class="s2">"orderId"</span><span class="p">:</span> <span class="mi">1573346959</span><span class="p">,</span>              <span class="c1">// 系统订单号</span>
    <span class="s2">"origQty"</span><span class="p">:</span> <span class="s2">"0.40"</span><span class="p">,</span>                  <span class="c1">// 原始委托数量</span>
    <span class="s2">"origType"</span><span class="p">:</span> <span class="s2">"TRAILING_STOP_MARKET"</span><span class="p">,</span> <span class="c1">// 触发前订单类型</span>
    <span class="s2">"price"</span><span class="p">:</span> <span class="s2">"0"</span><span class="p">,</span>                       <span class="c1">// 委托价格</span>
    <span class="s2">"reduceOnly"</span><span class="p">:</span> <span class="kc">false</span><span class="p">,</span>                <span class="c1">// 是否仅减仓</span>
    <span class="s2">"side"</span><span class="p">:</span> <span class="s2">"BUY"</span><span class="p">,</span>                      <span class="c1">// 买卖方向</span>
    <span class="s2">"positionSide"</span><span class="p">:</span> <span class="s2">"SHORT"</span><span class="p">,</span>            <span class="c1">// 持仓方向</span>
    <span class="s2">"status"</span><span class="p">:</span> <span class="s2">"NEW"</span><span class="p">,</span>                    <span class="c1">// 订单状态</span>
    <span class="s2">"stopPrice"</span><span class="p">:</span> <span class="s2">"9300"</span><span class="p">,</span>                    <span class="c1">// 触发价，对`TRAILING_STOP_MARKET`无效</span>
    <span class="s2">"closePosition"</span><span class="p">:</span> <span class="kc">false</span><span class="p">,</span>   <span class="c1">// 是否条件全平仓</span>
    <span class="s2">"symbol"</span><span class="p">:</span> <span class="s2">"BTCUSDT"</span><span class="p">,</span>                <span class="c1">// 交易对</span>
    <span class="s2">"time"</span><span class="p">:</span> <span class="mi">1579276756075</span><span class="p">,</span>              <span class="c1">// 订单时间</span>
    <span class="s2">"timeInForce"</span><span class="p">:</span> <span class="s2">"GTC"</span><span class="p">,</span>               <span class="c1">// 有效方法</span>
    <span class="s2">"type"</span><span class="p">:</span> <span class="s2">"TRAILING_STOP_MARKET"</span><span class="p">,</span>     <span class="c1">// 订单类型</span>
    <span class="s2">"activatePrice"</span><span class="p">:</span> <span class="s2">"9020"</span><span class="p">,</span>            <span class="c1">// 跟踪止损激活价格, 仅`TRAILING_STOP_MARKET` 订单返回此字段</span>
    <span class="s2">"priceRate"</span><span class="p">:</span> <span class="s2">"0.3"</span><span class="p">,</span>                 <span class="c1">// 跟踪止损回调比例, 仅`TRAILING_STOP_MARKET` 订单返回此字段</span>
    <span class="s2">"updateTime"</span><span class="p">:</span> <span class="mi">1579276756075</span><span class="p">,</span>        <span class="c1">// 更新时间</span>
    <span class="s2">"workingType"</span><span class="p">:</span> <span class="s2">"CONTRACT_PRICE"</span><span class="p">,</span> <span class="c1">// 条件价格触发类型</span>
    <span class="s2">"priceProtect"</span><span class="p">:</span> <span class="kc">false</span>            <span class="c1">// 是否开启条件单触发保护</span>
<span class="p">}</span>
</code></pre>
<p><code>
GET /fapi/v1/order (HMAC SHA256)
</code></p>

<p>查询订单状态</p>

<ul>
<li>请注意，如果订单满足如下条件，不会被查询到：

<ul>
<li>订单的最终状态为 <code>CANCELED</code> 或者 <code>EXPIRED</code>, <strong>并且</strong> </li>
<li>订单没有任何的成交记录, <strong>并且</strong></li>
<li>订单生成时间 + 7天 &lt; 当前时间</li>
</ul></li>
</ul>

<p><strong>权重:</strong>
1</p>

<p><strong>参数:</strong></p>

<table><thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必需</th>
<th>描述</th>
</tr>
</thead><tbody>
<tr>
<td>symbol</td>
<td>STRING</td>
<td>YES</td>
<td>交易对</td>
</tr>
<tr>
<td>orderId</td>
<td>LONG</td>
<td>NO</td>
<td>系统订单号</td>
</tr>
<tr>
<td>origClientOrderId</td>
<td>STRING</td>
<td>NO</td>
<td>用户自定义的订单号</td>
</tr>
<tr>
<td>recvWindow</td>
<td>LONG</td>
<td>NO</td>
<td></td>
</tr>
<tr>
<td>timestamp</td>
<td>LONG</td>
<td>YES</td>
<td></td>
</tr>
</tbody></table>

<p>注意:</p>

<ul>
<li>至少需要发送 <code>orderId</code> 与 <code>origClientOrderId</code>中的一个</li>
</ul>
<h2 id="trade-6">撤销订单 (TRADE)</h2>
<blockquote>
<p><strong>响应:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">{</span>
    <span class="s2">"clientOrderId"</span><span class="p">:</span> <span class="s2">"myOrder1"</span><span class="p">,</span> <span class="c1">// 用户自定义的订单号</span>
    <span class="s2">"cumQty"</span><span class="p">:</span> <span class="s2">"0"</span><span class="p">,</span>
    <span class="s2">"cumQuote"</span><span class="p">:</span> <span class="s2">"0"</span><span class="p">,</span> <span class="c1">// 成交金额</span>
    <span class="s2">"executedQty"</span><span class="p">:</span> <span class="s2">"0"</span><span class="p">,</span> <span class="c1">// 成交量</span>
    <span class="s2">"orderId"</span><span class="p">:</span> <span class="mi">283194212</span><span class="p">,</span> <span class="c1">// 系统订单号</span>
    <span class="s2">"origQty"</span><span class="p">:</span> <span class="s2">"11"</span><span class="p">,</span> <span class="c1">// 原始委托数量</span>
    <span class="s2">"price"</span><span class="p">:</span> <span class="s2">"0"</span><span class="p">,</span> <span class="c1">// 委托价格</span>
    <span class="s2">"reduceOnly"</span><span class="p">:</span> <span class="kc">false</span><span class="p">,</span> <span class="c1">// 仅减仓</span>
    <span class="s2">"side"</span><span class="p">:</span> <span class="s2">"BUY"</span><span class="p">,</span> <span class="c1">// 买卖方向</span>
    <span class="s2">"positionSide"</span><span class="p">:</span> <span class="s2">"SHORT"</span><span class="p">,</span> <span class="c1">// 持仓方向</span>
    <span class="s2">"status"</span><span class="p">:</span> <span class="s2">"CANCELED"</span><span class="p">,</span> <span class="c1">// 订单状态</span>
    <span class="s2">"stopPrice"</span><span class="p">:</span> <span class="s2">"9300"</span><span class="p">,</span> <span class="c1">// 触发价，对`TRAILING_STOP_MARKET`无效</span>
    <span class="s2">"closePosition"</span><span class="p">:</span> <span class="kc">false</span><span class="p">,</span>   <span class="c1">// 是否条件全平仓</span>
    <span class="s2">"symbol"</span><span class="p">:</span> <span class="s2">"BTCUSDT"</span><span class="p">,</span> <span class="c1">// 交易对</span>
    <span class="s2">"timeInForce"</span><span class="p">:</span> <span class="s2">"GTC"</span><span class="p">,</span> <span class="c1">// 有效方法</span>
    <span class="s2">"origType"</span><span class="p">:</span> <span class="s2">"TRAILING_STOP_MARKET"</span><span class="p">,</span> <span class="c1">// 触发前订单类型</span>
    <span class="s2">"type"</span><span class="p">:</span> <span class="s2">"TRAILING_STOP_MARKET"</span><span class="p">,</span> <span class="c1">// 订单类型</span>
    <span class="s2">"activatePrice"</span><span class="p">:</span> <span class="s2">"9020"</span><span class="p">,</span> <span class="c1">// 跟踪止损激活价格, 仅`TRAILING_STOP_MARKET` 订单返回此字段</span>
    <span class="s2">"priceRate"</span><span class="p">:</span> <span class="s2">"0.3"</span><span class="p">,</span> <span class="c1">// 跟踪止损回调比例, 仅`TRAILING_STOP_MARKET` 订单返回此字段</span>
    <span class="s2">"updateTime"</span><span class="p">:</span> <span class="mi">1571110484038</span><span class="p">,</span> <span class="c1">// 更新时间</span>
    <span class="s2">"workingType"</span><span class="p">:</span> <span class="s2">"CONTRACT_PRICE"</span><span class="p">,</span> <span class="c1">// 条件价格触发类型</span>
    <span class="s2">"priceProtect"</span><span class="p">:</span> <span class="kc">false</span>            <span class="c1">// 是否开启条件单触发保护</span>
<span class="p">}</span>
</code></pre>
<p><code>
DELETE /fapi/v1/order  (HMAC SHA256)
</code></p>

<p><strong>权重:</strong>
1</p>

<p><strong>Parameters:</strong></p>

<table><thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必需</th>
<th>描述</th>
</tr>
</thead><tbody>
<tr>
<td>symbol</td>
<td>STRING</td>
<td>YES</td>
<td>交易对</td>
</tr>
<tr>
<td>orderId</td>
<td>LONG</td>
<td>NO</td>
<td>系统订单号</td>
</tr>
<tr>
<td>origClientOrderId</td>
<td>STRING</td>
<td>NO</td>
<td>用户自定义的订单号</td>
</tr>
<tr>
<td>recvWindow</td>
<td>LONG</td>
<td>NO</td>
<td></td>
</tr>
<tr>
<td>timestamp</td>
<td>LONG</td>
<td>YES</td>
<td></td>
</tr>
</tbody></table>

<p><code>orderId</code> 与 <code>origClientOrderId</code> 必须至少发送一个</p>
<h2 id="trade-7">撤销全部订单 (TRADE)</h2>
<blockquote>
<p><strong>响应:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">{</span>
    <span class="s2">"code"</span><span class="p">:</span> <span class="s2">"200"</span><span class="p">,</span> 
    <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"The operation of cancel all open order is done."</span>
<span class="p">}</span>
</code></pre>
<p><code>
DELETE /fapi/v1/allOpenOrders  (HMAC SHA256)
</code></p>

<p><strong>权重:</strong>
1</p>

<p><strong>Parameters:</strong></p>

<table><thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必需</th>
<th>描述</th>
</tr>
</thead><tbody>
<tr>
<td>symbol</td>
<td>STRING</td>
<td>YES</td>
<td>交易对</td>
</tr>
<tr>
<td>recvWindow</td>
<td>LONG</td>
<td>NO</td>
<td></td>
</tr>
<tr>
<td>timestamp</td>
<td>LONG</td>
<td>YES</td>
<td></td>
</tr>
</tbody></table>
<h2 id="trade-8">批量撤销订单 (TRADE)</h2>
<blockquote>
<p><strong>响应:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">[</span>
    <span class="p">{</span>
        <span class="s2">"clientOrderId"</span><span class="p">:</span> <span class="s2">"myOrder1"</span><span class="p">,</span> <span class="c1">// 用户自定义的订单号</span>
        <span class="s2">"cumQty"</span><span class="p">:</span> <span class="s2">"0"</span><span class="p">,</span>
        <span class="s2">"cumQuote"</span><span class="p">:</span> <span class="s2">"0"</span><span class="p">,</span> <span class="c1">// 成交金额</span>
        <span class="s2">"executedQty"</span><span class="p">:</span> <span class="s2">"0"</span><span class="p">,</span> <span class="c1">// 成交量</span>
        <span class="s2">"orderId"</span><span class="p">:</span> <span class="mi">283194212</span><span class="p">,</span> <span class="c1">// 系统订单号</span>
        <span class="s2">"origQty"</span><span class="p">:</span> <span class="s2">"11"</span><span class="p">,</span> <span class="c1">// 原始委托数量</span>
        <span class="s2">"price"</span><span class="p">:</span> <span class="s2">"0"</span><span class="p">,</span> <span class="c1">// 委托价格</span>
        <span class="s2">"reduceOnly"</span><span class="p">:</span> <span class="kc">false</span><span class="p">,</span> <span class="c1">// 仅减仓</span>
        <span class="s2">"side"</span><span class="p">:</span> <span class="s2">"BUY"</span><span class="p">,</span> <span class="c1">// 买卖方向</span>
        <span class="s2">"positionSide"</span><span class="p">:</span> <span class="s2">"SHORT"</span><span class="p">,</span> <span class="c1">// 持仓方向</span>
        <span class="s2">"status"</span><span class="p">:</span> <span class="s2">"CANCELED"</span><span class="p">,</span> <span class="c1">// 订单状态</span>
        <span class="s2">"stopPrice"</span><span class="p">:</span> <span class="s2">"9300"</span><span class="p">,</span> <span class="c1">// 触发价，对`TRAILING_STOP_MARKET`无效</span>
        <span class="s2">"closePosition"</span><span class="p">:</span> <span class="kc">false</span><span class="p">,</span>   <span class="c1">// 是否条件全平仓</span>
        <span class="s2">"symbol"</span><span class="p">:</span> <span class="s2">"BTCUSDT"</span><span class="p">,</span> <span class="c1">// 交易对</span>
        <span class="s2">"timeInForce"</span><span class="p">:</span> <span class="s2">"GTC"</span><span class="p">,</span> <span class="c1">// 有效方法</span>
        <span class="s2">"origType"</span><span class="p">:</span> <span class="s2">"TRAILING_STOP_MARKET"</span><span class="p">,</span> <span class="c1">// 触发前订单类型</span>
        <span class="s2">"type"</span><span class="p">:</span> <span class="s2">"TRAILING_STOP_MARKET"</span><span class="p">,</span> <span class="c1">// 订单类型</span>
        <span class="s2">"activatePrice"</span><span class="p">:</span> <span class="s2">"9020"</span><span class="p">,</span> <span class="c1">// 跟踪止损激活价格, 仅`TRAILING_STOP_MARKET` 订单返回此字段</span>
        <span class="s2">"priceRate"</span><span class="p">:</span> <span class="s2">"0.3"</span><span class="p">,</span> <span class="c1">// 跟踪止损回调比例, 仅`TRAILING_STOP_MARKET` 订单返回此字段</span>
        <span class="s2">"updateTime"</span><span class="p">:</span> <span class="mi">1571110484038</span><span class="p">,</span> <span class="c1">// 更新时间</span>
        <span class="s2">"workingType"</span><span class="p">:</span> <span class="s2">"CONTRACT_PRICE"</span><span class="p">,</span> <span class="c1">// 条件价格触发类型</span>
        <span class="s2">"priceProtect"</span><span class="p">:</span> <span class="kc">false</span>            <span class="c1">// 是否开启条件单触发保护</span>
    <span class="p">},</span>
    <span class="p">{</span>
        <span class="s2">"code"</span><span class="p">:</span> <span class="o">-</span><span class="mi">2011</span><span class="p">,</span>
        <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"Unknown order sent."</span>
    <span class="p">}</span>
<span class="p">]</span>
</code></pre>
<p><code>
DELETE /fapi/v1/batchOrders  (HMAC SHA256)
</code></p>

<p><strong>权重:</strong>
1</p>

<p><strong>Parameters:</strong></p>

<table><thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必需</th>
<th>描述</th>
</tr>
</thead><tbody>
<tr>
<td>symbol</td>
<td>STRING</td>
<td>YES</td>
<td>交易对</td>
</tr>
<tr>
<td>orderIdList</td>
<td>LIST&lt;LONG&gt;</td>
<td>NO</td>
<td>系统订单号, 最多支持10个订单 <br> 比如<code>[1234567,2345678]</code></td>
</tr>
<tr>
<td>origClientOrderIdList</td>
<td>LIST&lt;STRING&gt;</td>
<td>NO</td>
<td>用户自定义的订单号, 最多支持10个订单 <br> 比如<code>["my_id_1","my_id_2"]</code> 需要encode双引号。逗号后面没有空格。</td>
</tr>
<tr>
<td>recvWindow</td>
<td>LONG</td>
<td>NO</td>
<td></td>
</tr>
<tr>
<td>timestamp</td>
<td>LONG</td>
<td>YES</td>
<td></td>
</tr>
</tbody></table>

<p><code>orderIdList</code> 与 <code>origClientOrderIdList</code> 必须至少发送一个，不可同时发送</p>
<h2 id="trade-9">倒计时撤销所有订单 (TRADE)</h2>
<blockquote>
<p><strong>响应:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">{</span>
    <span class="s2">"symbol"</span><span class="p">:</span> <span class="s2">"BTCUSDT"</span><span class="p">,</span> 
    <span class="s2">"countdownTime"</span><span class="p">:</span> <span class="s2">"100000"</span>
<span class="p">}</span>
</code></pre>
<p><code>
POST /fapi/v1/countdownCancelAll  (HMAC SHA256)
</code></p>

<p><strong>权重:</strong>
10</p>

<p><strong>Parameters:</strong></p>

<table><thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必需</th>
<th>描述</th>
</tr>
</thead><tbody>
<tr>
<td>symbol</td>
<td>STRING</td>
<td>YES</td>
<td></td>
</tr>
<tr>
<td>countdownTime</td>
<td>LONG</td>
<td>YES</td>
<td>倒计时。 1000 表示 1 秒； 0 表示取消倒计时撤单功能。</td>
</tr>
<tr>
<td>recvWindow</td>
<td>LONG</td>
<td>NO</td>
<td></td>
</tr>
<tr>
<td>timestamp</td>
<td>LONG</td>
<td>YES</td>
<td></td>
</tr>
</tbody></table>

<ul>
<li><p>该接口可以被用于确保在倒计时结束时撤销指定symbol上的所有挂单。 在使用这个功能时，接口应像心跳一样在倒计时内被反复调用，以便可以取消既有的倒计时并开始新的倒数计时设置。</p></li>
<li><p>用法示例：
以30s的间隔重复此接口，每次倒计时countdownTime设置为120000(120s)。<br>
如果在120秒内未再次调用此接口，则您指定symbol上的所有挂单都会被自动撤销。<br>
如果在120秒内以将countdownTime设置为0，则倒数计时器将终止，自动撤单功能取消。</p></li>
<li><p>系统会<strong>大约每10毫秒</strong>检查一次所有倒计时情况，因此请注意，使用此功能时应考虑足够的冗余。<br>
我们不建议将倒记时设置得太精确或太小。</p></li>
</ul>
<h2 id="user_data-4">查询当前挂单 (USER_DATA)</h2>
<blockquote>
<p><strong>响应:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code>
<span class="p">{</span>
    <span class="s2">"avgPrice"</span><span class="p">:</span> <span class="s2">"0.00000"</span><span class="p">,</span>              <span class="c1">// 平均成交价</span>
    <span class="s2">"clientOrderId"</span><span class="p">:</span> <span class="s2">"abc"</span><span class="p">,</span>             <span class="c1">// 用户自定义的订单号</span>
    <span class="s2">"cumQuote"</span><span class="p">:</span> <span class="s2">"0"</span><span class="p">,</span>                        <span class="c1">// 成交金额</span>
    <span class="s2">"executedQty"</span><span class="p">:</span> <span class="s2">"0"</span><span class="p">,</span>                 <span class="c1">// 成交量</span>
    <span class="s2">"orderId"</span><span class="p">:</span> <span class="mi">1917641</span><span class="p">,</span>                 <span class="c1">// 系统订单号</span>
    <span class="s2">"origQty"</span><span class="p">:</span> <span class="s2">"0.40"</span><span class="p">,</span>                  <span class="c1">// 原始委托数量</span>
    <span class="s2">"origType"</span><span class="p">:</span> <span class="s2">"TRAILING_STOP_MARKET"</span><span class="p">,</span> <span class="c1">// 触发前订单类型</span>
    <span class="s2">"price"</span><span class="p">:</span> <span class="s2">"0"</span><span class="p">,</span>                   <span class="c1">// 委托价格</span>
    <span class="s2">"reduceOnly"</span><span class="p">:</span> <span class="kc">false</span><span class="p">,</span>                <span class="c1">// 是否仅减仓</span>
    <span class="s2">"side"</span><span class="p">:</span> <span class="s2">"BUY"</span><span class="p">,</span>                      <span class="c1">// 买卖方向</span>
    <span class="s2">"status"</span><span class="p">:</span> <span class="s2">"NEW"</span><span class="p">,</span>                    <span class="c1">// 订单状态</span>
    <span class="s2">"positionSide"</span><span class="p">:</span> <span class="s2">"SHORT"</span><span class="p">,</span> <span class="c1">// 持仓方向</span>
    <span class="s2">"stopPrice"</span><span class="p">:</span> <span class="s2">"9300"</span><span class="p">,</span>                    <span class="c1">// 触发价，对`TRAILING_STOP_MARKET`无效</span>
    <span class="s2">"closePosition"</span><span class="p">:</span> <span class="kc">false</span><span class="p">,</span>   <span class="c1">// 是否条件全平仓</span>
    <span class="s2">"symbol"</span><span class="p">:</span> <span class="s2">"BTCUSDT"</span><span class="p">,</span>                <span class="c1">// 交易对</span>
    <span class="s2">"time"</span><span class="p">:</span> <span class="mi">1579276756075</span><span class="p">,</span>              <span class="c1">// 订单时间</span>
    <span class="s2">"timeInForce"</span><span class="p">:</span> <span class="s2">"GTC"</span><span class="p">,</span>               <span class="c1">// 有效方法</span>
    <span class="s2">"type"</span><span class="p">:</span> <span class="s2">"TRAILING_STOP_MARKET"</span><span class="p">,</span>     <span class="c1">// 订单类型</span>
    <span class="s2">"activatePrice"</span><span class="p">:</span> <span class="s2">"9020"</span><span class="p">,</span> <span class="c1">// 跟踪止损激活价格, 仅`TRAILING_STOP_MARKET` 订单返回此字段</span>
    <span class="s2">"priceRate"</span><span class="p">:</span> <span class="s2">"0.3"</span><span class="p">,</span> <span class="c1">// 跟踪止损回调比例, 仅`TRAILING_STOP_MARKET` 订单返回此字段</span>
    <span class="s2">"updateTime"</span><span class="p">:</span> <span class="mi">1579276756075</span><span class="p">,</span>        <span class="c1">// 更新时间</span>
    <span class="s2">"workingType"</span><span class="p">:</span> <span class="s2">"CONTRACT_PRICE"</span><span class="p">,</span> <span class="c1">// 条件价格触发类型</span>
    <span class="s2">"priceProtect"</span><span class="p">:</span> <span class="kc">false</span>            <span class="c1">// 是否开启条件单触发保护</span>
<span class="p">}</span>
</code></pre>
<p><code>
GET /fapi/v1/openOrder  (HMAC SHA256)
</code></p>

<p>请小心使用不带symbol参数的调用</p>

<p><strong>权重: 1</strong></p>

<p><strong>参数:</strong></p>

<table><thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必需</th>
<th>描述</th>
</tr>
</thead><tbody>
<tr>
<td>symbol</td>
<td>STRING</td>
<td>YES</td>
<td>交易对</td>
</tr>
<tr>
<td>orderId</td>
<td>LONG</td>
<td>NO</td>
<td>系统订单号</td>
</tr>
<tr>
<td>origClientOrderId</td>
<td>STRING</td>
<td>NO</td>
<td>用户自定义的订单号</td>
</tr>
<tr>
<td>recvWindow</td>
<td>LONG</td>
<td>NO</td>
<td></td>
</tr>
<tr>
<td>timestamp</td>
<td>LONG</td>
<td>YES</td>
<td></td>
</tr>
</tbody></table>

<ul>
<li><code>orderId</code> 与 <code>origClientOrderId</code> 中的一个为必填参数</li>
<li>查询的订单如果已经成交或取消，将返回报错 "Order does not exist."</li>
</ul>
<h2 id="user_data-5">查看当前全部挂单 (USER_DATA)</h2>
<blockquote>
<p><strong>响应:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">[</span>
  <span class="p">{</span>
    <span class="s2">"avgPrice"</span><span class="p">:</span> <span class="s2">"0.00000"</span><span class="p">,</span>              <span class="c1">// 平均成交价</span>
    <span class="s2">"clientOrderId"</span><span class="p">:</span> <span class="s2">"abc"</span><span class="p">,</span>             <span class="c1">// 用户自定义的订单号</span>
    <span class="s2">"cumQuote"</span><span class="p">:</span> <span class="s2">"0"</span><span class="p">,</span>                        <span class="c1">// 成交金额</span>
    <span class="s2">"executedQty"</span><span class="p">:</span> <span class="s2">"0"</span><span class="p">,</span>                 <span class="c1">// 成交量</span>
    <span class="s2">"orderId"</span><span class="p">:</span> <span class="mi">1917641</span><span class="p">,</span>                 <span class="c1">// 系统订单号</span>
    <span class="s2">"origQty"</span><span class="p">:</span> <span class="s2">"0.40"</span><span class="p">,</span>                  <span class="c1">// 原始委托数量</span>
    <span class="s2">"origType"</span><span class="p">:</span> <span class="s2">"TRAILING_STOP_MARKET"</span><span class="p">,</span> <span class="c1">// 触发前订单类型</span>
    <span class="s2">"price"</span><span class="p">:</span> <span class="s2">"0"</span><span class="p">,</span>                   <span class="c1">// 委托价格</span>
    <span class="s2">"reduceOnly"</span><span class="p">:</span> <span class="kc">false</span><span class="p">,</span>                <span class="c1">// 是否仅减仓</span>
    <span class="s2">"side"</span><span class="p">:</span> <span class="s2">"BUY"</span><span class="p">,</span>                      <span class="c1">// 买卖方向</span>
    <span class="s2">"positionSide"</span><span class="p">:</span> <span class="s2">"SHORT"</span><span class="p">,</span> <span class="c1">// 持仓方向</span>
    <span class="s2">"status"</span><span class="p">:</span> <span class="s2">"NEW"</span><span class="p">,</span>                    <span class="c1">// 订单状态</span>
    <span class="s2">"stopPrice"</span><span class="p">:</span> <span class="s2">"9300"</span><span class="p">,</span>                    <span class="c1">// 触发价，对`TRAILING_STOP_MARKET`无效</span>
    <span class="s2">"closePosition"</span><span class="p">:</span> <span class="kc">false</span><span class="p">,</span>   <span class="c1">// 是否条件全平仓</span>
    <span class="s2">"symbol"</span><span class="p">:</span> <span class="s2">"BTCUSDT"</span><span class="p">,</span>                <span class="c1">// 交易对</span>
    <span class="s2">"time"</span><span class="p">:</span> <span class="mi">1579276756075</span><span class="p">,</span>              <span class="c1">// 订单时间</span>
    <span class="s2">"timeInForce"</span><span class="p">:</span> <span class="s2">"GTC"</span><span class="p">,</span>               <span class="c1">// 有效方法</span>
    <span class="s2">"type"</span><span class="p">:</span> <span class="s2">"TRAILING_STOP_MARKET"</span><span class="p">,</span>     <span class="c1">// 订单类型</span>
    <span class="s2">"activatePrice"</span><span class="p">:</span> <span class="s2">"9020"</span><span class="p">,</span> <span class="c1">// 跟踪止损激活价格, 仅`TRAILING_STOP_MARKET` 订单返回此字段</span>
    <span class="s2">"priceRate"</span><span class="p">:</span> <span class="s2">"0.3"</span><span class="p">,</span> <span class="c1">// 跟踪止损回调比例, 仅`TRAILING_STOP_MARKET` 订单返回此字段</span>
    <span class="s2">"updateTime"</span><span class="p">:</span> <span class="mi">1579276756075</span><span class="p">,</span>        <span class="c1">// 更新时间</span>
    <span class="s2">"workingType"</span><span class="p">:</span> <span class="s2">"CONTRACT_PRICE"</span><span class="p">,</span> <span class="c1">// 条件价格触发类型</span>
    <span class="s2">"priceProtect"</span><span class="p">:</span> <span class="kc">false</span>            <span class="c1">// 是否开启条件单触发保护</span>
  <span class="p">}</span>
<span class="p">]</span>
</code></pre>
<p><code>
GET /fapi/v1/openOrders  (HMAC SHA256)
</code></p>

<p>请小心使用不带symbol参数的调用</p>

<p><strong>权重:</strong>
- 带symbol <strong><em>1</em></strong>
- 不带 <strong><em>40</em></strong></p>

<p><strong>参数:</strong></p>

<table><thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必需</th>
<th>描述</th>
</tr>
</thead><tbody>
<tr>
<td>symbol</td>
<td>STRING</td>
<td>NO</td>
<td>交易对</td>
</tr>
<tr>
<td>recvWindow</td>
<td>LONG</td>
<td>NO</td>
<td></td>
</tr>
<tr>
<td>timestamp</td>
<td>LONG</td>
<td>YES</td>
<td></td>
</tr>
</tbody></table>

<ul>
<li>不带symbol参数，会返回所有交易对的挂单</li>
</ul>
<h2 id="user_data-6">查询所有订单(包括历史订单) (USER_DATA)</h2>
<blockquote>
<p><strong>响应:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">[</span>
  <span class="p">{</span>
    <span class="s2">"avgPrice"</span><span class="p">:</span> <span class="s2">"0.00000"</span><span class="p">,</span>              <span class="c1">// 平均成交价</span>
    <span class="s2">"clientOrderId"</span><span class="p">:</span> <span class="s2">"abc"</span><span class="p">,</span>             <span class="c1">// 用户自定义的订单号</span>
    <span class="s2">"cumQuote"</span><span class="p">:</span> <span class="s2">"0"</span><span class="p">,</span>                        <span class="c1">// 成交金额</span>
    <span class="s2">"executedQty"</span><span class="p">:</span> <span class="s2">"0"</span><span class="p">,</span>                 <span class="c1">// 成交量</span>
    <span class="s2">"orderId"</span><span class="p">:</span> <span class="mi">1917641</span><span class="p">,</span>                 <span class="c1">// 系统订单号</span>
    <span class="s2">"origQty"</span><span class="p">:</span> <span class="s2">"0.40"</span><span class="p">,</span>                  <span class="c1">// 原始委托数量</span>
    <span class="s2">"origType"</span><span class="p">:</span> <span class="s2">"TRAILING_STOP_MARKET"</span><span class="p">,</span> <span class="c1">// 触发前订单类型</span>
    <span class="s2">"price"</span><span class="p">:</span> <span class="s2">"0"</span><span class="p">,</span>                   <span class="c1">// 委托价格</span>
    <span class="s2">"reduceOnly"</span><span class="p">:</span> <span class="kc">false</span><span class="p">,</span>                <span class="c1">// 是否仅减仓</span>
    <span class="s2">"side"</span><span class="p">:</span> <span class="s2">"BUY"</span><span class="p">,</span>                      <span class="c1">// 买卖方向</span>
    <span class="s2">"positionSide"</span><span class="p">:</span> <span class="s2">"SHORT"</span><span class="p">,</span> <span class="c1">// 持仓方向</span>
    <span class="s2">"status"</span><span class="p">:</span> <span class="s2">"NEW"</span><span class="p">,</span>                    <span class="c1">// 订单状态</span>
    <span class="s2">"stopPrice"</span><span class="p">:</span> <span class="s2">"9300"</span><span class="p">,</span>                    <span class="c1">// 触发价，对`TRAILING_STOP_MARKET`无效</span>
    <span class="s2">"closePosition"</span><span class="p">:</span> <span class="kc">false</span><span class="p">,</span>             <span class="c1">// 是否条件全平仓</span>
    <span class="s2">"symbol"</span><span class="p">:</span> <span class="s2">"BTCUSDT"</span><span class="p">,</span>                <span class="c1">// 交易对</span>
    <span class="s2">"time"</span><span class="p">:</span> <span class="mi">1579276756075</span><span class="p">,</span>              <span class="c1">// 订单时间</span>
    <span class="s2">"timeInForce"</span><span class="p">:</span> <span class="s2">"GTC"</span><span class="p">,</span>               <span class="c1">// 有效方法</span>
    <span class="s2">"type"</span><span class="p">:</span> <span class="s2">"TRAILING_STOP_MARKET"</span><span class="p">,</span>     <span class="c1">// 订单类型</span>
    <span class="s2">"activatePrice"</span><span class="p">:</span> <span class="s2">"9020"</span><span class="p">,</span> <span class="c1">// 跟踪止损激活价格, 仅`TRAILING_STOP_MARKET` 订单返回此字段</span>
    <span class="s2">"priceRate"</span><span class="p">:</span> <span class="s2">"0.3"</span><span class="p">,</span> <span class="c1">// 跟踪止损回调比例, 仅`TRAILING_STOP_MARKET` 订单返回此字段</span>
    <span class="s2">"updateTime"</span><span class="p">:</span> <span class="mi">1579276756075</span><span class="p">,</span>        <span class="c1">// 更新时间</span>
    <span class="s2">"workingType"</span><span class="p">:</span> <span class="s2">"CONTRACT_PRICE"</span><span class="p">,</span> <span class="c1">// 条件价格触发类型</span>
    <span class="s2">"priceProtect"</span><span class="p">:</span> <span class="kc">false</span>            <span class="c1">// 是否开启条件单触发保护</span>
  <span class="p">}</span>
<span class="p">]</span>
</code></pre>
<p><code>
GET /fapi/v1/allOrders (HMAC SHA256)
</code></p>

<ul>
<li>请注意，如果订单满足如下条件，不会被查询到：

<ul>
<li>订单的最终状态为 <code>CANCELED</code> 或者 <code>EXPIRED</code>, <strong>并且</strong> </li>
<li>订单没有任何的成交记录, <strong>并且</strong></li>
<li>订单生成时间 + 7天 &lt; 当前时间</li>
</ul></li>
</ul>

<p><strong>权重:</strong>
5 </p>

<p><strong>Parameters:</strong></p>

<table><thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必需</th>
<th>描述</th>
</tr>
</thead><tbody>
<tr>
<td>symbol</td>
<td>STRING</td>
<td>YES</td>
<td>交易对</td>
</tr>
<tr>
<td>orderId</td>
<td>LONG</td>
<td>NO</td>
<td>只返回此orderID及之后的订单，缺省返回最近的订单</td>
</tr>
<tr>
<td>startTime</td>
<td>LONG</td>
<td>NO</td>
<td>起始时间</td>
</tr>
<tr>
<td>endTime</td>
<td>LONG</td>
<td>NO</td>
<td>结束时间</td>
</tr>
<tr>
<td>limit</td>
<td>INT</td>
<td>NO</td>
<td>返回的结果集数量 默认值:500 最大值:1000</td>
</tr>
<tr>
<td>recvWindow</td>
<td>LONG</td>
<td>NO</td>
<td></td>
</tr>
<tr>
<td>timestamp</td>
<td>LONG</td>
<td>YES</td>
<td></td>
</tr>
</tbody></table>

<ul>
<li>查询时间范围最大不得超过7天</li>
<li>默认查询最近7天内的数据</li>
</ul>
<h2 id="v2-user_data">账户余额V2 (USER_DATA)</h2>
<blockquote>
<p><strong>响应:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">[</span>
    <span class="p">{</span>
        <span class="s2">"accountAlias"</span><span class="p">:</span> <span class="s2">"SgsR"</span><span class="p">,</span>    <span class="c1">// 账户唯一识别码</span>
        <span class="s2">"asset"</span><span class="p">:</span> <span class="s2">"USDT"</span><span class="p">,</span>        <span class="c1">// 资产</span>
        <span class="s2">"balance"</span><span class="p">:</span> <span class="s2">"122607.35137903"</span><span class="p">,</span>   <span class="c1">// 总余额</span>
        <span class="s2">"crossWalletBalance"</span><span class="p">:</span> <span class="s2">"23.72469206"</span><span class="p">,</span> <span class="c1">// 全仓余额</span>
        <span class="s2">"crossUnPnl"</span><span class="p">:</span> <span class="s2">"0.00000000"</span>  <span class="c1">// 全仓持仓未实现盈亏</span>
        <span class="s2">"availableBalance"</span><span class="p">:</span> <span class="s2">"23.72469206"</span><span class="p">,</span>       <span class="c1">// 下单可用余额</span>
        <span class="s2">"maxWithdrawAmount"</span><span class="p">:</span> <span class="s2">"23.72469206"</span><span class="p">,</span>     <span class="c1">// 最大可转出余额</span>
        <span class="s2">"marginAvailable"</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span>    <span class="c1">// 是否可用作联合保证金</span>
        <span class="s2">"updateTime"</span><span class="p">:</span> <span class="mi">1617939110373</span>
    <span class="p">}</span>
<span class="p">]</span>
</code></pre>
<p><code>
GET /fapi/v2/balance (HMAC SHA256)
</code></p>

<p><strong>Weight:</strong>
5</p>

<p><strong>Parameters:</strong></p>

<table><thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必需</th>
<th>描述</th>
</tr>
</thead><tbody>
<tr>
<td>recvWindow</td>
<td>LONG</td>
<td>NO</td>
<td></td>
</tr>
<tr>
<td>timestamp</td>
<td>LONG</td>
<td>YES</td>
<td></td>
</tr>
</tbody></table>
<h2 id="v2-user_data-2">账户信息V2 (USER_DATA)</h2>
<blockquote>
<p><strong>响应:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code>
<span class="p">{</span>
    <span class="s2">"feeTier"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>  <span class="c1">// 手续费等级</span>
    <span class="s2">"canTrade"</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span>  <span class="c1">// 是否可以交易</span>
    <span class="s2">"canDeposit"</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span>  <span class="c1">// 是否可以入金</span>
    <span class="s2">"canWithdraw"</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span> <span class="c1">// 是否可以出金</span>
    <span class="s2">"updateTime"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
    <span class="s2">"totalInitialMargin"</span><span class="p">:</span> <span class="s2">"0.00000000"</span><span class="p">,</span>  <span class="c1">// 但前所需起始保证金总额(存在逐仓请忽略), 仅计算usdt资产</span>
    <span class="s2">"totalMaintMargin"</span><span class="p">:</span> <span class="s2">"0.00000000"</span><span class="p">,</span>  <span class="c1">// 维持保证金总额, 仅计算usdt资产</span>
    <span class="s2">"totalWalletBalance"</span><span class="p">:</span> <span class="s2">"23.72469206"</span><span class="p">,</span>   <span class="c1">// 账户总余额, 仅计算usdt资产</span>
    <span class="s2">"totalUnrealizedProfit"</span><span class="p">:</span> <span class="s2">"0.00000000"</span><span class="p">,</span>  <span class="c1">// 持仓未实现盈亏总额, 仅计算usdt资产</span>
    <span class="s2">"totalMarginBalance"</span><span class="p">:</span> <span class="s2">"23.72469206"</span><span class="p">,</span>  <span class="c1">// 保证金总余额, 仅计算usdt资产</span>
    <span class="s2">"totalPositionInitialMargin"</span><span class="p">:</span> <span class="s2">"0.00000000"</span><span class="p">,</span>  <span class="c1">// 持仓所需起始保证金(基于最新标记价格), 仅计算usdt资产</span>
    <span class="s2">"totalOpenOrderInitialMargin"</span><span class="p">:</span> <span class="s2">"0.00000000"</span><span class="p">,</span>  <span class="c1">// 当前挂单所需起始保证金(基于最新标记价格), 仅计算usdt资产</span>
    <span class="s2">"totalCrossWalletBalance"</span><span class="p">:</span> <span class="s2">"23.72469206"</span><span class="p">,</span>  <span class="c1">// 全仓账户余额, 仅计算usdt资产</span>
    <span class="s2">"totalCrossUnPnl"</span><span class="p">:</span> <span class="s2">"0.00000000"</span><span class="p">,</span>    <span class="c1">// 全仓持仓未实现盈亏总额, 仅计算usdt资产</span>
    <span class="s2">"availableBalance"</span><span class="p">:</span> <span class="s2">"23.72469206"</span><span class="p">,</span>       <span class="c1">// 可用余额, 仅计算usdt资产</span>
    <span class="s2">"maxWithdrawAmount"</span><span class="p">:</span> <span class="s2">"23.72469206"</span>     <span class="c1">// 最大可转出余额, 仅计算usdt资产</span>
    <span class="s2">"assets"</span><span class="p">:</span> <span class="p">[</span>
        <span class="p">{</span>
            <span class="s2">"asset"</span><span class="p">:</span> <span class="s2">"USDT"</span><span class="p">,</span>        <span class="c1">//资产</span>
            <span class="s2">"walletBalance"</span><span class="p">:</span> <span class="s2">"23.72469206"</span><span class="p">,</span>  <span class="c1">//余额</span>
            <span class="s2">"unrealizedProfit"</span><span class="p">:</span> <span class="s2">"0.00000000"</span><span class="p">,</span>  <span class="c1">// 未实现盈亏</span>
            <span class="s2">"marginBalance"</span><span class="p">:</span> <span class="s2">"23.72469206"</span><span class="p">,</span>  <span class="c1">// 保证金余额</span>
            <span class="s2">"maintMargin"</span><span class="p">:</span> <span class="s2">"0.00000000"</span><span class="p">,</span>    <span class="c1">// 维持保证金</span>
            <span class="s2">"initialMargin"</span><span class="p">:</span> <span class="s2">"0.00000000"</span><span class="p">,</span>  <span class="c1">// 当前所需起始保证金</span>
            <span class="s2">"positionInitialMargin"</span><span class="p">:</span> <span class="s2">"0.00000000"</span><span class="p">,</span>  <span class="c1">// 持仓所需起始保证金(基于最新标记价格)</span>
            <span class="s2">"openOrderInitialMargin"</span><span class="p">:</span> <span class="s2">"0.00000000"</span><span class="p">,</span> <span class="c1">// 当前挂单所需起始保证金(基于最新标记价格)</span>
            <span class="s2">"crossWalletBalance"</span><span class="p">:</span> <span class="s2">"23.72469206"</span><span class="p">,</span>  <span class="c1">//全仓账户余额</span>
            <span class="s2">"crossUnPnl"</span><span class="p">:</span> <span class="s2">"0.00000000"</span> <span class="c1">// 全仓持仓未实现盈亏</span>
            <span class="s2">"availableBalance"</span><span class="p">:</span> <span class="s2">"23.72469206"</span><span class="p">,</span>       <span class="c1">// 可用余额</span>
            <span class="s2">"maxWithdrawAmount"</span><span class="p">:</span> <span class="s2">"23.72469206"</span><span class="p">,</span>     <span class="c1">// 最大可转出余额</span>
            <span class="s2">"marginAvailable"</span><span class="p">:</span> <span class="kc">true</span>    <span class="c1">// 是否可用作联合保证金</span>
        <span class="p">},</span>
        <span class="p">{</span>
            <span class="s2">"asset"</span><span class="p">:</span> <span class="s2">"BUSD"</span><span class="p">,</span>        <span class="c1">//资产</span>
            <span class="s2">"walletBalance"</span><span class="p">:</span> <span class="s2">"103.12345678"</span><span class="p">,</span>  <span class="c1">//余额</span>
            <span class="s2">"unrealizedProfit"</span><span class="p">:</span> <span class="s2">"0.00000000"</span><span class="p">,</span>  <span class="c1">// 未实现盈亏</span>
            <span class="s2">"marginBalance"</span><span class="p">:</span> <span class="s2">"103.12345678"</span><span class="p">,</span>  <span class="c1">// 保证金余额</span>
            <span class="s2">"maintMargin"</span><span class="p">:</span> <span class="s2">"0.00000000"</span><span class="p">,</span>    <span class="c1">// 维持保证金</span>
            <span class="s2">"initialMargin"</span><span class="p">:</span> <span class="s2">"0.00000000"</span><span class="p">,</span>  <span class="c1">// 当前所需起始保证金</span>
            <span class="s2">"positionInitialMargin"</span><span class="p">:</span> <span class="s2">"0.00000000"</span><span class="p">,</span>  <span class="c1">// 持仓所需起始保证金(基于最新标记价格)</span>
            <span class="s2">"openOrderInitialMargin"</span><span class="p">:</span> <span class="s2">"0.00000000"</span><span class="p">,</span> <span class="c1">// 当前挂单所需起始保证金(基于最新标记价格)</span>
            <span class="s2">"crossWalletBalance"</span><span class="p">:</span> <span class="s2">"103.12345678"</span><span class="p">,</span>  <span class="c1">//全仓账户余额</span>
            <span class="s2">"crossUnPnl"</span><span class="p">:</span> <span class="s2">"0.00000000"</span> <span class="c1">// 全仓持仓未实现盈亏</span>
            <span class="s2">"availableBalance"</span><span class="p">:</span> <span class="s2">"103.12345678"</span><span class="p">,</span>       <span class="c1">// 可用余额</span>
            <span class="s2">"maxWithdrawAmount"</span><span class="p">:</span> <span class="s2">"103.12345678"</span><span class="p">,</span>     <span class="c1">// 最大可转出余额</span>
            <span class="s2">"marginAvailable"</span><span class="p">:</span> <span class="kc">true</span>    <span class="c1">// 否可用作联合保证金</span>
        <span class="p">}</span>
    <span class="p">],</span>
    <span class="s2">"positions"</span><span class="p">:</span> <span class="p">[</span>  <span class="c1">// 头寸，将返回所有市场symbol。</span>
        <span class="c1">//根据用户持仓模式展示持仓方向，即双向模式下只返回BOTH持仓情况，单向模式下只返回 LONG 和 SHORT 持仓情况</span>
        <span class="p">{</span>
            <span class="s2">"symbol"</span><span class="p">:</span> <span class="s2">"BTCUSDT"</span><span class="p">,</span>  <span class="c1">// 交易对</span>
            <span class="s2">"initialMargin"</span><span class="p">:</span> <span class="s2">"0"</span><span class="p">,</span>   <span class="c1">// 当前所需起始保证金(基于最新标记价格)</span>
            <span class="s2">"maintMargin"</span><span class="p">:</span> <span class="s2">"0"</span><span class="p">,</span> <span class="c1">//维持保证金</span>
            <span class="s2">"unrealizedProfit"</span><span class="p">:</span> <span class="s2">"0.00000000"</span><span class="p">,</span>  <span class="c1">// 持仓未实现盈亏</span>
            <span class="s2">"positionInitialMargin"</span><span class="p">:</span> <span class="s2">"0"</span><span class="p">,</span>  <span class="c1">// 持仓所需起始保证金(基于最新标记价格)</span>
            <span class="s2">"openOrderInitialMargin"</span><span class="p">:</span> <span class="s2">"0"</span><span class="p">,</span>  <span class="c1">// 当前挂单所需起始保证金(基于最新标记价格)</span>
            <span class="s2">"leverage"</span><span class="p">:</span> <span class="s2">"100"</span><span class="p">,</span>  <span class="c1">// 杠杆倍率</span>
            <span class="s2">"isolated"</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span>  <span class="c1">// 是否是逐仓模式</span>
            <span class="s2">"entryPrice"</span><span class="p">:</span> <span class="s2">"0.00000"</span><span class="p">,</span>  <span class="c1">// 持仓成本价</span>
            <span class="s2">"maxNotional"</span><span class="p">:</span> <span class="s2">"250000"</span><span class="p">,</span>  <span class="c1">// 当前杠杆下用户可用的最大名义价值</span>
            <span class="s2">"positionSide"</span><span class="p">:</span> <span class="s2">"BOTH"</span><span class="p">,</span>  <span class="c1">// 持仓方向</span>
            <span class="s2">"positionAmt"</span><span class="p">:</span> <span class="s2">"0"</span>      <span class="c1">// 持仓数量</span>
        <span class="p">}</span>
    <span class="p">]</span>
<span class="p">}</span>
</code></pre>
<p><code>
GET /fapi/v2/account (HMAC SHA256)
</code></p>

<p><strong>权重:</strong>
5</p>

<p><strong>参数:</strong></p>

<table><thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必需</th>
<th>描述</th>
</tr>
</thead><tbody>
<tr>
<td>recvWindow</td>
<td>LONG</td>
<td>NO</td>
<td></td>
</tr>
<tr>
<td>timestamp</td>
<td>LONG</td>
<td>YES</td>
<td></td>
</tr>
</tbody></table>
<h2 id="trade-10">调整开仓杠杆 (TRADE)</h2>
<blockquote>
<p><strong>响应:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">{</span>
    <span class="s2">"leverage"</span><span class="p">:</span> <span class="mi">21</span><span class="p">,</span> <span class="c1">// 杠杆倍数</span>
    <span class="s2">"maxNotionalValue"</span><span class="p">:</span> <span class="s2">"1000000"</span><span class="p">,</span> <span class="c1">// 当前杠杆倍数下允许的最大名义价值</span>
    <span class="s2">"symbol"</span><span class="p">:</span> <span class="s2">"BTCUSDT"</span> <span class="c1">// 交易对</span>
<span class="p">}</span>
</code></pre>
<p><code>
POST /fapi/v1/leverage (HMAC SHA256)
</code></p>

<p>调整用户在指定symbol合约的开仓杠杆。</p>

<p><strong>权重:</strong>
1</p>

<p><strong>参数:</strong></p>

<table><thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必需</th>
<th>描述</th>
</tr>
</thead><tbody>
<tr>
<td>symbol</td>
<td>STRING</td>
<td>YES</td>
<td>交易对</td>
</tr>
<tr>
<td>leverage</td>
<td>INT</td>
<td>YES</td>
<td>目标杠杆倍数：1 到 125 整数</td>
</tr>
<tr>
<td>recvWindow</td>
<td>LONG</td>
<td>NO</td>
<td></td>
</tr>
<tr>
<td>timestamp</td>
<td>LONG</td>
<td>YES</td>
<td></td>
</tr>
</tbody></table>
<h2 id="trade-11">变换逐全仓模式 (TRADE)</h2>
<blockquote>
<p><strong>响应:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">{</span>
    <span class="s2">"code"</span><span class="p">:</span> <span class="mi">200</span><span class="p">,</span>
    <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"success"</span>
<span class="p">}</span>
</code></pre>
<p><code>
POST /fapi/v1/marginType (HMAC SHA256)
</code></p>

<p>变换用户在指定symbol合约上的保证金模式：逐仓或全仓。</p>

<p><strong>权重:</strong>
1</p>

<p><strong>参数:</strong></p>

<table><thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必需</th>
<th>描述</th>
</tr>
</thead><tbody>
<tr>
<td>symbol</td>
<td>STRING</td>
<td>YES</td>
<td>交易对</td>
</tr>
<tr>
<td>marginType</td>
<td>ENUM</td>
<td>YES</td>
<td>保证金模式 ISOLATED(逐仓), CROSSED(全仓)</td>
</tr>
<tr>
<td>recvWindow</td>
<td>LONG</td>
<td>NO</td>
<td></td>
</tr>
<tr>
<td>timestamp</td>
<td>LONG</td>
<td>YES</td>
<td></td>
</tr>
</tbody></table>
<h2 id="trade-12">调整逐仓保证金 (TRADE)</h2>
<blockquote>
<p><strong>响应:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">{</span>
    <span class="s2">"amount"</span><span class="p">:</span> <span class="mf">100.0</span><span class="p">,</span>
    <span class="s2">"code"</span><span class="p">:</span> <span class="mi">200</span><span class="p">,</span>
    <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"Successfully modify position margin."</span><span class="p">,</span>
    <span class="s2">"type"</span><span class="p">:</span> <span class="mi">1</span>
<span class="p">}</span>
</code></pre>
<p><code>
POST /fapi/v1/positionMargin (HMAC SHA256)
</code></p>

<p>针对逐仓模式下的仓位，调整其逐仓保证金资金。</p>

<p><strong>权重:</strong>
1</p>

<p><strong>参数:</strong></p>

<table><thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必需</th>
<th>描述</th>
</tr>
</thead><tbody>
<tr>
<td>symbol</td>
<td>STRING</td>
<td>YES</td>
<td>交易对</td>
</tr>
<tr>
<td>positionSide</td>
<td>ENUM</td>
<td>NO</td>
<td>持仓方向，单向持仓模式下非必填，默认且仅可填<code>BOTH</code>;在双向持仓模式下必填,且仅可选择 <code>LONG</code> 或 <code>SHORT</code></td>
</tr>
<tr>
<td>amount</td>
<td>DECIMAL</td>
<td>YES</td>
<td>保证金资金</td>
</tr>
<tr>
<td>type</td>
<td>INT</td>
<td>YES</td>
<td>调整方向 1: 增加逐仓保证金，2: 减少逐仓保证金</td>
</tr>
<tr>
<td>recvWindow</td>
<td>LONG</td>
<td>NO</td>
<td></td>
</tr>
<tr>
<td>timestamp</td>
<td>LONG</td>
<td>YES</td>
<td></td>
</tr>
</tbody></table>

<ul>
<li>只针对逐仓symbol 与 positionSide(如有)</li>
</ul>
<h2 id="trade-13">逐仓保证金变动历史 (TRADE)</h2>
<blockquote>
<p><strong>响应:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">[</span>
    <span class="p">{</span>
        <span class="s2">"amount"</span><span class="p">:</span> <span class="s2">"23.36332311"</span><span class="p">,</span> <span class="c1">// 数量</span>
        <span class="s2">"asset"</span><span class="p">:</span> <span class="s2">"USDT"</span><span class="p">,</span> <span class="c1">// 资产</span>
        <span class="s2">"symbol"</span><span class="p">:</span> <span class="s2">"BTCUSDT"</span><span class="p">,</span> <span class="c1">// 交易对</span>
        <span class="s2">"time"</span><span class="p">:</span> <span class="mi">1578047897183</span><span class="p">,</span> <span class="c1">// 时间</span>
        <span class="s2">"type"</span><span class="p">:</span> <span class="mi">1</span><span class="err">，</span>    <span class="c1">// 调整方向</span>
        <span class="s2">"positionSide"</span><span class="p">:</span> <span class="s2">"BOTH"</span>  <span class="c1">// 持仓方向</span>
    <span class="p">},</span>
    <span class="p">{</span>
        <span class="s2">"amount"</span><span class="p">:</span> <span class="s2">"100"</span><span class="p">,</span>
        <span class="s2">"asset"</span><span class="p">:</span> <span class="s2">"USDT"</span><span class="p">,</span>
        <span class="s2">"symbol"</span><span class="p">:</span> <span class="s2">"BTCUSDT"</span><span class="p">,</span>
        <span class="s2">"time"</span><span class="p">:</span> <span class="mi">1578047900425</span><span class="p">,</span>
        <span class="s2">"type"</span><span class="p">:</span> <span class="mi">1</span><span class="err">，</span>
        <span class="s2">"positionSide"</span><span class="p">:</span> <span class="s2">"LONG"</span> 
    <span class="p">}</span>
<span class="p">]</span>
</code></pre>
<p><code>
GET /fapi/v1/positionMargin/history (HMAC SHA256)
</code></p>

<p><strong>权重:</strong>
1</p>

<p><strong>参数:</strong></p>

<table><thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必需</th>
<th>描述</th>
</tr>
</thead><tbody>
<tr>
<td>symbol</td>
<td>STRING</td>
<td>YES</td>
<td>交易对</td>
</tr>
<tr>
<td>type</td>
<td>INT</td>
<td>NO</td>
<td>调整方向 1: 增加逐仓保证金，2: 减少逐仓保证金</td>
</tr>
<tr>
<td>startTime</td>
<td>LONG</td>
<td>NO</td>
<td>起始时间</td>
</tr>
<tr>
<td>endTime</td>
<td>LONG</td>
<td>NO</td>
<td>结束时间</td>
</tr>
<tr>
<td>limit</td>
<td>INT</td>
<td>NO</td>
<td>返回的结果集数量 默认值: 500</td>
</tr>
<tr>
<td>recvWindow</td>
<td>LONG</td>
<td>NO</td>
<td></td>
</tr>
<tr>
<td>timestamp</td>
<td>LONG</td>
<td>YES</td>
<td></td>
</tr>
</tbody></table>
<h2 id="v2-user_data-3">用户持仓风险V2 (USER_DATA)</h2>
<blockquote>
<p><strong>响应:</strong></p>

<p>单向持仓模式下：</p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">[</span>
    <span class="p">{</span>
        <span class="s2">"entryPrice"</span><span class="p">:</span> <span class="s2">"0.00000"</span><span class="p">,</span> <span class="c1">// 开仓均价</span>
        <span class="s2">"marginType"</span><span class="p">:</span> <span class="s2">"isolated"</span><span class="p">,</span> <span class="c1">// 逐仓模式或全仓模式</span>
        <span class="s2">"isAutoAddMargin"</span><span class="p">:</span> <span class="s2">"false"</span><span class="p">,</span>
        <span class="s2">"isolatedMargin"</span><span class="p">:</span> <span class="s2">"0.00000000"</span><span class="p">,</span> <span class="c1">// 逐仓保证金</span>
        <span class="s2">"leverage"</span><span class="p">:</span> <span class="s2">"10"</span><span class="p">,</span> <span class="c1">// 当前杠杆倍数</span>
        <span class="s2">"liquidationPrice"</span><span class="p">:</span> <span class="s2">"0"</span><span class="p">,</span> <span class="c1">// 参考强平价格</span>
        <span class="s2">"markPrice"</span><span class="p">:</span> <span class="s2">"6679.50671178"</span><span class="p">,</span>   <span class="c1">// 当前标记价格</span>
        <span class="s2">"maxNotionalValue"</span><span class="p">:</span> <span class="s2">"20000000"</span><span class="p">,</span> <span class="c1">// 当前杠杆倍数允许的名义价值上限</span>
        <span class="s2">"positionAmt"</span><span class="p">:</span> <span class="s2">"0.000"</span><span class="p">,</span> <span class="c1">// 头寸数量，符号代表多空方向, 正数为多，负数为空</span>
        <span class="s2">"symbol"</span><span class="p">:</span> <span class="s2">"BTCUSDT"</span><span class="p">,</span> <span class="c1">// 交易对</span>
        <span class="s2">"unRealizedProfit"</span><span class="p">:</span> <span class="s2">"0.00000000"</span><span class="p">,</span> <span class="c1">// 持仓未实现盈亏</span>
        <span class="s2">"positionSide"</span><span class="p">:</span> <span class="s2">"BOTH"</span><span class="p">,</span> <span class="c1">// 持仓方向</span>
    <span class="p">}</span>
<span class="p">]</span>
</code></pre>
<blockquote>
<p>双向持仓模式下：</p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">[</span>
    <span class="p">{</span>
        <span class="s2">"entryPrice"</span><span class="p">:</span> <span class="s2">"6563.66500"</span><span class="p">,</span> <span class="c1">// 开仓均价</span>
        <span class="s2">"marginType"</span><span class="p">:</span> <span class="s2">"isolated"</span><span class="p">,</span> <span class="c1">// 逐仓模式或全仓模式</span>
        <span class="s2">"isAutoAddMargin"</span><span class="p">:</span> <span class="s2">"false"</span><span class="p">,</span>
        <span class="s2">"isolatedMargin"</span><span class="p">:</span> <span class="s2">"15517.54150468"</span><span class="p">,</span> <span class="c1">// 逐仓保证金</span>
        <span class="s2">"leverage"</span><span class="p">:</span> <span class="s2">"10"</span><span class="p">,</span> <span class="c1">// 当前杠杆倍数</span>
        <span class="s2">"liquidationPrice"</span><span class="p">:</span> <span class="s2">"5930.78"</span><span class="p">,</span> <span class="c1">// 参考强平价格</span>
        <span class="s2">"markPrice"</span><span class="p">:</span> <span class="s2">"6679.50671178"</span><span class="p">,</span>   <span class="c1">// 当前标记价格</span>
        <span class="s2">"maxNotionalValue"</span><span class="p">:</span> <span class="s2">"20000000"</span><span class="p">,</span> <span class="c1">// 当前杠杆倍数允许的名义价值上限</span>
        <span class="s2">"positionAmt"</span><span class="p">:</span> <span class="s2">"20.000"</span><span class="p">,</span> <span class="c1">// 头寸数量，符号代表多空方向, 正数为多，负数为空</span>
        <span class="s2">"symbol"</span><span class="p">:</span> <span class="s2">"BTCUSDT"</span><span class="p">,</span> <span class="c1">// 交易对</span>
        <span class="s2">"unRealizedProfit"</span><span class="p">:</span> <span class="s2">"2316.83423560"</span> <span class="c1">// 持仓未实现盈亏</span>
        <span class="s2">"positionSide"</span><span class="p">:</span> <span class="s2">"LONG"</span><span class="p">,</span> <span class="c1">// 持仓方向</span>
    <span class="p">},</span>
    <span class="p">{</span>
        <span class="s2">"entryPrice"</span><span class="p">:</span> <span class="s2">"0.00000"</span><span class="p">,</span> <span class="c1">// 开仓均价</span>
        <span class="s2">"marginType"</span><span class="p">:</span> <span class="s2">"isolated"</span><span class="p">,</span> <span class="c1">// 逐仓模式或全仓模式</span>
        <span class="s2">"isAutoAddMargin"</span><span class="p">:</span> <span class="s2">"false"</span><span class="p">,</span>
        <span class="s2">"isolatedMargin"</span><span class="p">:</span> <span class="s2">"5413.95799991"</span><span class="p">,</span> <span class="c1">// 逐仓保证金</span>
        <span class="s2">"leverage"</span><span class="p">:</span> <span class="s2">"10"</span><span class="p">,</span> <span class="c1">// 当前杠杆倍数</span>
        <span class="s2">"liquidationPrice"</span><span class="p">:</span> <span class="s2">"7189.95"</span><span class="p">,</span> <span class="c1">// 参考强平价格</span>
        <span class="s2">"markPrice"</span><span class="p">:</span> <span class="s2">"6679.50671178"</span><span class="p">,</span>   <span class="c1">// 当前标记价格</span>
        <span class="s2">"maxNotionalValue"</span><span class="p">:</span> <span class="s2">"20000000"</span><span class="p">,</span> <span class="c1">// 当前杠杆倍数允许的名义价值上限</span>
        <span class="s2">"positionAmt"</span><span class="p">:</span> <span class="s2">"-10.000"</span><span class="p">,</span> <span class="c1">// 头寸数量，符号代表多空方向, 正数为多，负数为空</span>
        <span class="s2">"symbol"</span><span class="p">:</span> <span class="s2">"BTCUSDT"</span><span class="p">,</span> <span class="c1">// 交易对</span>
        <span class="s2">"unRealizedProfit"</span><span class="p">:</span> <span class="s2">"-1156.46711780"</span> <span class="c1">// 持仓未实现盈亏</span>
        <span class="s2">"positionSide"</span><span class="p">:</span> <span class="s2">"SHORT"</span><span class="p">,</span> <span class="c1">// 持仓方向</span>
    <span class="p">}</span>

<span class="p">]</span>
</code></pre>
<p><code>
GET /fapi/v2/positionRisk (HMAC SHA256)
</code></p>

<p><strong>权重:</strong>
5</p>

<p><strong>参数:</strong></p>

<table><thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必需</th>
<th>描述</th>
</tr>
</thead><tbody>
<tr>
<td>symbol</td>
<td>STRING</td>
<td>NO</td>
<td></td>
</tr>
<tr>
<td>recvWindow</td>
<td>LONG</td>
<td>NO</td>
<td></td>
</tr>
<tr>
<td>timestamp</td>
<td>LONG</td>
<td>YES</td>
<td></td>
</tr>
</tbody></table>

<p><strong>注意</strong><br>
请与账户推送信息<code>ACCOUNT_UPDATE</code>配合使用，以满足您的及时性和准确性需求。</p>
<h2 id="user_data-7">账户成交历史 (USER_DATA)</h2>
<blockquote>
<p><strong>响应:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">[</span>
  <span class="p">{</span>
    <span class="s2">"buyer"</span><span class="p">:</span> <span class="kc">false</span><span class="p">,</span> <span class="c1">// 是否是买方</span>
    <span class="s2">"commission"</span><span class="p">:</span> <span class="s2">"-0.07819010"</span><span class="p">,</span> <span class="c1">// 手续费</span>
    <span class="s2">"commissionAsset"</span><span class="p">:</span> <span class="s2">"USDT"</span><span class="p">,</span> <span class="c1">// 手续费计价单位</span>
    <span class="s2">"id"</span><span class="p">:</span> <span class="mi">698759</span><span class="p">,</span>   <span class="c1">// 交易ID</span>
    <span class="s2">"maker"</span><span class="p">:</span> <span class="kc">false</span><span class="p">,</span> <span class="c1">// 是否是挂单方</span>
    <span class="s2">"orderId"</span><span class="p">:</span> <span class="mi">25851813</span><span class="p">,</span> <span class="c1">// 订单编号</span>
    <span class="s2">"price"</span><span class="p">:</span> <span class="s2">"7819.01"</span><span class="p">,</span> <span class="c1">// 成交价</span>
    <span class="s2">"qty"</span><span class="p">:</span> <span class="s2">"0.002"</span><span class="p">,</span> <span class="c1">// 成交量</span>
    <span class="s2">"quoteQty"</span><span class="p">:</span> <span class="s2">"15.63802"</span><span class="p">,</span> <span class="c1">// 成交额</span>
    <span class="s2">"realizedPnl"</span><span class="p">:</span> <span class="s2">"-0.91539999"</span><span class="p">,</span>   <span class="c1">// 实现盈亏</span>
    <span class="s2">"side"</span><span class="p">:</span> <span class="s2">"SELL"</span><span class="p">,</span> <span class="c1">// 买卖方向</span>
    <span class="s2">"positionSide"</span><span class="p">:</span> <span class="s2">"SHORT"</span><span class="p">,</span>  <span class="c1">// 持仓方向</span>
    <span class="s2">"symbol"</span><span class="p">:</span> <span class="s2">"BTCUSDT"</span><span class="p">,</span> <span class="c1">// 交易对</span>
    <span class="s2">"time"</span><span class="p">:</span> <span class="mi">1569514978020</span> <span class="c1">// 时间</span>
  <span class="p">}</span>
<span class="p">]</span>
</code></pre>
<p><code>
GET /fapi/v1/userTrades  (HMAC SHA256)
</code></p>

<p>获取某交易对的成交历史</p>

<p><strong>权重:</strong>
5</p>

<p><strong>参数:</strong></p>

<table><thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必需</th>
<th>描述</th>
</tr>
</thead><tbody>
<tr>
<td>symbol</td>
<td>STRING</td>
<td>YES</td>
<td>交易对</td>
</tr>
<tr>
<td>startTime</td>
<td>LONG</td>
<td>NO</td>
<td>起始时间</td>
</tr>
<tr>
<td>endTime</td>
<td>LONG</td>
<td>NO</td>
<td>结束时间</td>
</tr>
<tr>
<td>fromId</td>
<td>LONG</td>
<td>NO</td>
<td>返回该fromId及之后的成交，缺省返回最近的成交</td>
</tr>
<tr>
<td>limit</td>
<td>INT</td>
<td>NO</td>
<td>返回的结果集数量 默认值:500 最大值:1000.</td>
</tr>
<tr>
<td>recvWindow</td>
<td>LONG</td>
<td>NO</td>
<td></td>
</tr>
<tr>
<td>timestamp</td>
<td>LONG</td>
<td>YES</td>
<td></td>
</tr>
</tbody></table>

<ul>
<li>startTime 和 endTime 的最大间隔为7天</li>
</ul>
<h2 id="user_data-8">获取账户损益资金流水(USER_DATA)</h2>
<blockquote>
<p><strong>响应:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">[</span>
    <span class="p">{</span>
        <span class="s2">"symbol"</span><span class="p">:</span> <span class="s2">""</span><span class="p">,</span> <span class="c1">// 交易对，仅针对涉及交易对的资金流</span>
        <span class="s2">"incomeType"</span><span class="p">:</span> <span class="s2">"TRANSFER"</span><span class="p">,</span>   <span class="c1">// 资金流类型</span>
        <span class="s2">"income"</span><span class="p">:</span> <span class="s2">"-0.37500000"</span><span class="p">,</span> <span class="c1">// 资金流数量，正数代表流入，负数代表流出</span>
        <span class="s2">"asset"</span><span class="p">:</span> <span class="s2">"USDT"</span><span class="p">,</span> <span class="c1">// 资产内容</span>
        <span class="s2">"info"</span><span class="p">:</span><span class="s2">"TRANSFER"</span><span class="p">,</span> <span class="c1">// 备注信息，取决于流水类型</span>
        <span class="s2">"time"</span><span class="p">:</span> <span class="mi">1570608000000</span><span class="p">,</span> <span class="c1">// 时间</span>
        <span class="s2">"tranId"</span><span class="p">:</span><span class="s2">"9689322392"</span><span class="p">,</span>      <span class="c1">// 划转ID</span>
        <span class="s2">"tradeId"</span><span class="p">:</span><span class="s2">""</span>                    <span class="c1">// 引起流水产生的原始交易ID</span>
    <span class="p">},</span>
    <span class="p">{</span>
        <span class="s2">"symbol"</span><span class="p">:</span> <span class="s2">"BTCUSDT"</span><span class="p">,</span>
        <span class="s2">"incomeType"</span><span class="p">:</span> <span class="s2">"COMMISSION"</span><span class="p">,</span> 
        <span class="s2">"income"</span><span class="p">:</span> <span class="s2">"-0.01000000"</span><span class="p">,</span>
        <span class="s2">"asset"</span><span class="p">:</span> <span class="s2">"USDT"</span><span class="p">,</span>
        <span class="s2">"info"</span><span class="p">:</span><span class="s2">"COMMISSION"</span><span class="p">,</span>
        <span class="s2">"time"</span><span class="p">:</span> <span class="mi">1570636800000</span><span class="p">,</span>
        <span class="s2">"tranId"</span><span class="p">:</span><span class="s2">"9689322392"</span><span class="p">,</span>      
        <span class="s2">"tradeId"</span><span class="p">:</span><span class="s2">"2059192"</span>                 
    <span class="p">}</span>
<span class="p">]</span>
</code></pre>
<p><code>
GET /fapi/v1/income (HMAC SHA256)
</code></p>

<p><strong>权重:</strong>
30</p>

<p><strong>参数:</strong></p>

<table><thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必需</th>
<th>描述</th>
</tr>
</thead><tbody>
<tr>
<td>symbol</td>
<td>STRING</td>
<td>NO</td>
<td>交易对</td>
</tr>
<tr>
<td>incomeType</td>
<td>STRING</td>
<td>NO</td>
<td>收益类型 "TRANSFER"，"WELCOME_BONUS", "REALIZED_PNL"，"FUNDING_FEE", "COMMISSION", and "INSURANCE_CLEAR"</td>
</tr>
<tr>
<td>startTime</td>
<td>LONG</td>
<td>NO</td>
<td>起始时间</td>
</tr>
<tr>
<td>endTime</td>
<td>LONG</td>
<td>NO</td>
<td>结束时间</td>
</tr>
<tr>
<td>limit</td>
<td>INT</td>
<td>NO</td>
<td>返回的结果集数量 默认值:100 最大值:1000</td>
</tr>
<tr>
<td>recvWindow</td>
<td>LONG</td>
<td>NO</td>
<td></td>
</tr>
<tr>
<td>timestamp</td>
<td>LONG</td>
<td>YES</td>
<td></td>
</tr>
</tbody></table>

<ul>
<li>如果<code>startTime</code> 和 <code>endTime</code> 均未发送, 只会返回最近7天的数据。</li>
<li>如果<code>incomeType</code>没有发送，返回所有类型账户损益资金流水。</li>
<li>"trandId" 在相同用户的同一种收益流水类型中是唯一的。</li>
</ul>
<h2 id="user_data-9">杠杆分层标准 (USER_DATA)</h2>
<blockquote>
<p><strong>响应:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">[</span>
    <span class="p">{</span>
        <span class="s2">"symbol"</span><span class="p">:</span> <span class="s2">"ETHUSDT"</span><span class="p">,</span>
        <span class="s2">"brackets"</span><span class="p">:</span> <span class="p">[</span>
            <span class="p">{</span>
                <span class="s2">"bracket"</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span>   <span class="c1">// 层级</span>
                <span class="s2">"initialLeverage"</span><span class="p">:</span> <span class="mi">75</span><span class="p">,</span>  <span class="c1">// 该层允许的最高初始杠杆倍数</span>
                <span class="s2">"notionalCap"</span><span class="p">:</span> <span class="mi">10000</span><span class="p">,</span>  <span class="c1">// 该层对应的名义价值上限</span>
                <span class="s2">"notionalFloor"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>  <span class="c1">// 该层对应的名义价值下限 </span>
                <span class="s2">"maintMarginRatio"</span><span class="p">:</span> <span class="mf">0.0065</span><span class="p">,</span> <span class="c1">// 该层对应的维持保证金率</span>
                <span class="s2">"cum"</span><span class="p">:</span><span class="mi">0</span> <span class="c1">// 速算数</span>
            <span class="p">},</span>
        <span class="p">]</span>
    <span class="p">}</span>
<span class="p">]</span>
</code></pre>
<blockquote>
<p><strong>或</strong> (若发送symbol)</p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code>
<span class="p">{</span>
    <span class="s2">"symbol"</span><span class="p">:</span> <span class="s2">"ETHUSDT"</span><span class="p">,</span>
    <span class="s2">"brackets"</span><span class="p">:</span> <span class="p">[</span>
        <span class="p">{</span>
            <span class="s2">"bracket"</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span>
            <span class="s2">"initialLeverage"</span><span class="p">:</span> <span class="mi">75</span><span class="p">,</span>
            <span class="s2">"notionalCap"</span><span class="p">:</span> <span class="mi">10000</span><span class="p">,</span>
            <span class="s2">"notionalFloor"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
            <span class="s2">"maintMarginRatio"</span><span class="p">:</span> <span class="mf">0.0065</span><span class="p">,</span>
            <span class="s2">"cum"</span><span class="p">:</span><span class="mi">0</span>
        <span class="p">},</span>
    <span class="p">]</span>
<span class="p">}</span>
</code></pre>
<p><code>
GET /fapi/v1/leverageBracket
</code></p>

<p><strong>权重:</strong> 1</p>

<p><strong>参数:</strong></p>

<table><thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必需</th>
<th>描述</th>
</tr>
</thead><tbody>
<tr>
<td>symbol</td>
<td>STRING</td>
<td>NO</td>
<td></td>
</tr>
<tr>
<td>recvWindow</td>
<td>LONG</td>
<td>NO</td>
<td></td>
</tr>
<tr>
<td>timestamp</td>
<td>LONG</td>
<td>YES</td>
<td></td>
</tr>
</tbody></table>
<h2 id="adl-user_data">持仓ADL队列估算 (USER_DATA)</h2>
<blockquote>
<p><strong>响应:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">[</span>
    <span class="p">{</span>
        <span class="s2">"symbol"</span><span class="p">:</span> <span class="s2">"ETHUSDT"</span><span class="p">,</span> 
        <span class="s2">"adlQuantile"</span><span class="p">:</span> 
            <span class="p">{</span>
                <span class="c1">// 对于全仓状态下的双向持仓模式的交易对，会返回 "LONG", "SHORT" 和 "HEDGE", 其中"HEDGE"的存在仅作为标记;如果多空均有持仓的情况下,"LONG"和"SHORT"应返回共同计算后相同的队列分数。</span>
                <span class="s2">"LONG"</span><span class="p">:</span> <span class="mi">3</span><span class="p">,</span>  
                <span class="s2">"SHORT"</span><span class="p">:</span> <span class="mi">3</span><span class="p">,</span> 
                <span class="s2">"HEDGE"</span><span class="p">:</span> <span class="mi">0</span>   <span class="c1">// HEDGE 仅作为指示出现，请忽略数值</span>
            <span class="p">}</span>
        <span class="p">},</span>
    <span class="p">{</span>
        <span class="s2">"symbol"</span><span class="p">:</span> <span class="s2">"BTCUSDT"</span><span class="p">,</span> 
        <span class="s2">"adlQuantile"</span><span class="p">:</span> 
            <span class="p">{</span>
                <span class="c1">// 对于单向持仓模式或者是逐仓状态下的双向持仓模式的交易对，会返回 "LONG", "SHORT" 和 "BOTH" 分别表示不同持仓方向上持仓的adl队列分数</span>
                <span class="s2">"LONG"</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span>  <span class="c1">// 双开模式下多头持仓的ADL队列估算分</span>
                <span class="s2">"SHORT"</span><span class="p">:</span> <span class="mi">2</span><span class="p">,</span>     <span class="c1">// 双开模式下空头持仓的ADL队列估算分</span>
                <span class="s2">"BOTH"</span><span class="p">:</span> <span class="mi">0</span>       <span class="c1">// 单开模式下持仓的ADL队列估算分</span>
            <span class="p">}</span>
    <span class="p">}</span>
 <span class="p">]</span>
</code></pre>
<p><code>
GET /fapi/v1/adlQuantile
</code></p>

<p><strong>权重:</strong> 5</p>

<p><strong>参数:</strong></p>

<table><thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必需</th>
<th>描述</th>
</tr>
</thead><tbody>
<tr>
<td>symbol</td>
<td>STRING</td>
<td>NO</td>
<td></td>
</tr>
<tr>
<td>recvWindow</td>
<td>LONG</td>
<td>NO</td>
<td></td>
</tr>
<tr>
<td>timestamp</td>
<td>LONG</td>
<td>YES</td>
<td></td>
</tr>
</tbody></table>

<ul>
<li><p>每30秒更新数据</p></li>
<li><p>队列分数0，1，2，3，4，分数越高说明在ADL队列中的位置越靠前</p></li>
<li><p>对于单向持仓模式或者是逐仓状态下的双向持仓模式的交易对，会返回 "LONG", "SHORT" 和 "BOTH" 分别表示不同持仓方向上持仓的adl队列分数</p></li>
<li><p>对于全仓状态下的双向持仓模式的交易对，会返回 "LONG", "SHORT" 和 "HEDGE", 其中"HEDGE"的存在仅作为标记;其中如果多空均有持仓的情况下,"LONG"和"SHORT"返回共同计算后相同的队列分数。</p></li>
</ul>
<h2 id="user_data-10">用户强平单历史 (USER_DATA)</h2>
<blockquote>
<p><strong>响应:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">[</span>
  <span class="p">{</span>
    <span class="s2">"orderId"</span><span class="p">:</span> <span class="mi">6071832819</span><span class="p">,</span> 
    <span class="s2">"symbol"</span><span class="p">:</span> <span class="s2">"BTCUSDT"</span><span class="p">,</span> 
    <span class="s2">"status"</span><span class="p">:</span> <span class="s2">"FILLED"</span><span class="p">,</span> 
    <span class="s2">"clientOrderId"</span><span class="p">:</span> <span class="s2">"autoclose-1596107620040000020"</span><span class="p">,</span> 
    <span class="s2">"price"</span><span class="p">:</span> <span class="s2">"10871.09"</span><span class="p">,</span> 
    <span class="s2">"avgPrice"</span><span class="p">:</span> <span class="s2">"10913.21000"</span><span class="p">,</span> 
    <span class="s2">"origQty"</span><span class="p">:</span> <span class="s2">"0.001"</span><span class="p">,</span> 
    <span class="s2">"executedQty"</span><span class="p">:</span> <span class="s2">"0.001"</span><span class="p">,</span> 
    <span class="s2">"cumQuote"</span><span class="p">:</span> <span class="s2">"10.91321"</span><span class="p">,</span> 
    <span class="s2">"timeInForce"</span><span class="p">:</span> <span class="s2">"IOC"</span><span class="p">,</span> 
    <span class="s2">"type"</span><span class="p">:</span> <span class="s2">"LIMIT"</span><span class="p">,</span> 
    <span class="s2">"reduceOnly"</span><span class="p">:</span> <span class="kc">false</span><span class="p">,</span> 
    <span class="s2">"closePosition"</span><span class="p">:</span> <span class="kc">false</span><span class="p">,</span> 
    <span class="s2">"side"</span><span class="p">:</span> <span class="s2">"SELL"</span><span class="p">,</span> 
    <span class="s2">"positionSide"</span><span class="p">:</span> <span class="s2">"BOTH"</span><span class="p">,</span> 
    <span class="s2">"stopPrice"</span><span class="p">:</span> <span class="s2">"0"</span><span class="p">,</span> 
    <span class="s2">"workingType"</span><span class="p">:</span> <span class="s2">"CONTRACT_PRICE"</span><span class="p">,</span> 
    <span class="s2">"origType"</span><span class="p">:</span> <span class="s2">"LIMIT"</span><span class="p">,</span> 
    <span class="s2">"time"</span><span class="p">:</span> <span class="mi">1596107620044</span><span class="p">,</span> 
    <span class="s2">"updateTime"</span><span class="p">:</span> <span class="mi">1596107620087</span>
  <span class="p">}</span>
  <span class="p">{</span>
    <span class="s2">"orderId"</span><span class="p">:</span> <span class="mi">6072734303</span><span class="p">,</span> 
    <span class="s2">"symbol"</span><span class="p">:</span> <span class="s2">"BTCUSDT"</span><span class="p">,</span> 
    <span class="s2">"status"</span><span class="p">:</span> <span class="s2">"FILLED"</span><span class="p">,</span> 
    <span class="s2">"clientOrderId"</span><span class="p">:</span> <span class="s2">"adl_autoclose"</span><span class="p">,</span> 
    <span class="s2">"price"</span><span class="p">:</span> <span class="s2">"11023.14"</span><span class="p">,</span> 
    <span class="s2">"avgPrice"</span><span class="p">:</span> <span class="s2">"10979.82000"</span><span class="p">,</span> 
    <span class="s2">"origQty"</span><span class="p">:</span> <span class="s2">"0.001"</span><span class="p">,</span> 
    <span class="s2">"executedQty"</span><span class="p">:</span> <span class="s2">"0.001"</span><span class="p">,</span> 
    <span class="s2">"cumQuote"</span><span class="p">:</span> <span class="s2">"10.97982"</span><span class="p">,</span> 
    <span class="s2">"timeInForce"</span><span class="p">:</span> <span class="s2">"GTC"</span><span class="p">,</span> 
    <span class="s2">"type"</span><span class="p">:</span> <span class="s2">"LIMIT"</span><span class="p">,</span> 
    <span class="s2">"reduceOnly"</span><span class="p">:</span> <span class="kc">false</span><span class="p">,</span> 
    <span class="s2">"closePosition"</span><span class="p">:</span> <span class="kc">false</span><span class="p">,</span> 
    <span class="s2">"side"</span><span class="p">:</span> <span class="s2">"BUY"</span><span class="p">,</span> 
    <span class="s2">"positionSide"</span><span class="p">:</span> <span class="s2">"SHORT"</span><span class="p">,</span> 
    <span class="s2">"stopPrice"</span><span class="p">:</span> <span class="s2">"0"</span><span class="p">,</span> 
    <span class="s2">"workingType"</span><span class="p">:</span> <span class="s2">"CONTRACT_PRICE"</span><span class="p">,</span> 
    <span class="s2">"origType"</span><span class="p">:</span> <span class="s2">"LIMIT"</span><span class="p">,</span> 
    <span class="s2">"time"</span><span class="p">:</span> <span class="mi">1596110725059</span><span class="p">,</span> 
    <span class="s2">"updateTime"</span><span class="p">:</span> <span class="mi">1596110725071</span>
  <span class="p">}</span>
<span class="p">]</span>
</code></pre>
<p><code>
GET /fapi/v1/forceOrders
</code></p>

<p><strong>权重:</strong> 带symbol 20, 不带symbol 50</p>

<p><strong>参数:</strong></p>

<table><thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必需</th>
<th>描述</th>
</tr>
</thead><tbody>
<tr>
<td>symbol</td>
<td>STRING</td>
<td>NO</td>
<td></td>
</tr>
<tr>
<td>autoCloseType</td>
<td>ENUM</td>
<td>NO</td>
<td>"LIQUIDATION": 强平单, "ADL": ADL减仓单.</td>
</tr>
<tr>
<td>startTime</td>
<td>LONG</td>
<td>NO</td>
<td></td>
</tr>
<tr>
<td>endTime</td>
<td>LONG</td>
<td>NO</td>
<td></td>
</tr>
<tr>
<td>limit</td>
<td>INT</td>
<td>NO</td>
<td>Default 50; max 100.</td>
</tr>
<tr>
<td>recvWindow</td>
<td>LONG</td>
<td>NO</td>
<td></td>
</tr>
<tr>
<td>timestamp</td>
<td>LONG</td>
<td>YES</td>
<td></td>
</tr>
</tbody></table>

<ul>
<li>如果没有传 "autoCloseType", 强平单和ADL减仓单都会被返回</li>
<li>如果没有传"startTime", 只会返回"endTime"之前7天内的数据</li>
</ul>
<h2 id="api-user_data">用户 API 交易量化规则指标 (USER_DATA)</h2>
<ul>
<li>更多细节, 请参考<a href="https://www.binance.com/cn/support/faq/4f462ebe6ff445d4a170be7d9e897272">合约API交易量化规则</a></li>
</ul>

<blockquote>
<p><strong>响应:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">{</span>
    <span class="s2">"indicators"</span><span class="p">:</span> <span class="p">{</span> <span class="c1">// indicator:风控指标名, value:用户在该市场的风控指标数值, triggerValue:阈值, 对于没有达到记录阈值的则不返回数据。</span>
        <span class="s2">"BTCUSDT"</span><span class="p">:</span> <span class="p">[</span>
            <span class="p">{</span>
                <span class="s2">"isLocked"</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span> <span class="c1">// 用户该品种交易是否被风控禁用</span>
                <span class="s2">"plannedRecoverTime"</span><span class="p">:</span> <span class="mi">1545741270000</span><span class="p">,</span> <span class="c1">// 预计恢复时间，若当前时间大等于预计恢复时间则为空</span>
                <span class="s2">"indicator"</span><span class="p">:</span> <span class="s2">"UFR"</span><span class="p">,</span>  <span class="c1">// Unfilled Ratio (UFR)</span>
                <span class="s2">"value"</span><span class="p">:</span> <span class="mf">0.05</span><span class="p">,</span>  <span class="c1">// Current value</span>
                <span class="s2">"triggerValue"</span><span class="p">:</span> <span class="mf">0.995</span>  <span class="c1">// Trigger value</span>
            <span class="p">},</span>
            <span class="p">{</span>
                <span class="s2">"isLocked"</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span> <span class="c1">// 用户该品种交易是否被风控禁用</span>
                <span class="s2">"plannedRecoverTime"</span><span class="p">:</span> <span class="mi">1545741270000</span><span class="p">,</span>
                <span class="s2">"indicator"</span><span class="p">:</span> <span class="s2">"IFER"</span><span class="p">,</span>  <span class="c1">// IOC/FOK Expiration Ratio (IFER)</span>
                <span class="s2">"value"</span><span class="p">:</span> <span class="mf">0.99</span><span class="p">,</span>  <span class="c1">// Current value</span>
                <span class="s2">"triggerValue"</span><span class="p">:</span> <span class="mf">0.99</span>  <span class="c1">// Trigger value</span>
            <span class="p">},</span>
            <span class="p">{</span>
                <span class="s2">"isLocked"</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span> <span class="c1">// 用户该品种交易是否被风控禁用</span>
                <span class="s2">"plannedRecoverTime"</span><span class="p">:</span> <span class="mi">1545741270000</span><span class="p">,</span>
                <span class="s2">"indicator"</span><span class="p">:</span> <span class="s2">"GCR"</span><span class="p">,</span>  <span class="c1">// GTC Cancellation Ratio (GCR)</span>
                <span class="s2">"value"</span><span class="p">:</span> <span class="mf">0.99</span><span class="p">,</span>  <span class="c1">// Current value</span>
                <span class="s2">"triggerValue"</span><span class="p">:</span> <span class="mf">0.99</span>  <span class="c1">// Trigger value</span>
            <span class="p">},</span>
            <span class="p">{</span>
                <span class="s2">"isLocked"</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span> <span class="c1">// 用户该品种交易是否被风控禁用</span>
                <span class="s2">"plannedRecoverTime"</span><span class="p">:</span> <span class="mi">1545741270000</span><span class="p">,</span>
                <span class="s2">"indicator"</span><span class="p">:</span> <span class="s2">"DR"</span><span class="p">,</span>  <span class="c1">// Dust Ratio (DR)</span>
                <span class="s2">"value"</span><span class="p">:</span> <span class="mf">0.99</span><span class="p">,</span>  <span class="c1">// Current value</span>
                <span class="s2">"triggerValue"</span><span class="p">:</span> <span class="mf">0.99</span>  <span class="c1">// Trigger value</span>
            <span class="p">}</span>
        <span class="p">],</span>
        <span class="s2">"ETHUSDT"</span><span class="p">:</span> <span class="p">[</span>
            <span class="p">{</span>
                <span class="s2">"isLocked"</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span> <span class="c1">// 用户该品种交易是否被风控禁用</span>
                <span class="s2">"plannedRecoverTime"</span><span class="p">:</span> <span class="mi">1545741270000</span><span class="p">,</span>
                <span class="s2">"indicator"</span><span class="p">:</span> <span class="s2">"UFR"</span><span class="p">,</span>
                <span class="s2">"value"</span><span class="p">:</span> <span class="mf">0.05</span><span class="p">,</span>
                <span class="s2">"triggerValue"</span><span class="p">:</span> <span class="mf">0.995</span>
            <span class="p">},</span>
            <span class="p">{</span>
                <span class="s2">"isLocked"</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span> <span class="c1">// 用户该品种交易是否被风控禁用</span>
                <span class="s2">"plannedRecoverTime"</span><span class="p">:</span> <span class="mi">1545741270000</span><span class="p">,</span>
                <span class="s2">"indicator"</span><span class="p">:</span> <span class="s2">"IFER"</span><span class="p">,</span>
                <span class="s2">"value"</span><span class="p">:</span> <span class="mf">0.99</span><span class="p">,</span>
                <span class="s2">"triggerValue"</span><span class="p">:</span> <span class="mf">0.99</span>
            <span class="p">},</span>
            <span class="p">{</span>
                <span class="s2">"isLocked"</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span> <span class="c1">// 用户该品种交易是否被风控禁用</span>
                <span class="s2">"plannedRecoverTime"</span><span class="p">:</span> <span class="mi">1545741270000</span><span class="p">,</span>
                <span class="s2">"indicator"</span><span class="p">:</span> <span class="s2">"GCR"</span><span class="p">,</span>
                <span class="s2">"value"</span><span class="p">:</span> <span class="mf">0.99</span><span class="p">,</span>
                <span class="s2">"triggerValue"</span><span class="p">:</span> <span class="mf">0.99</span>
            <span class="p">}</span>
            <span class="p">{</span>
                <span class="s2">"isLocked"</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span> <span class="c1">// 用户该品种交易是否被风控禁用</span>
                <span class="s2">"plannedRecoverTime"</span><span class="p">:</span> <span class="mi">1545741270000</span><span class="p">,</span>
                <span class="s2">"indicator"</span><span class="p">:</span> <span class="s2">"DR"</span><span class="p">,</span>
                <span class="s2">"value"</span><span class="p">:</span> <span class="mf">0.99</span><span class="p">,</span>
                <span class="s2">"triggerValue"</span><span class="p">:</span> <span class="mf">0.99</span>
            <span class="p">}</span>
        <span class="p">]</span>
    <span class="p">},</span>
    <span class="s2">"updateTime"</span><span class="p">:</span> <span class="mi">1545741270000</span> <span class="c1">// 返回值的更新时间</span>
<span class="p">}</span>
</code></pre>
<p><code>
GET /fapi/v1/apiTradingStatus
</code></p>

<p><strong>权重:</strong></p>

<ul>
<li>带 symbol <strong><em>1</em></strong></li>
<li>不带 <strong><em>10</em></strong></li>
</ul>

<p><strong>参数:</strong></p>

<table><thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必需</th>
<th>描述</th>
</tr>
</thead><tbody>
<tr>
<td>symbol</td>
<td>STRING</td>
<td>NO</td>
<td></td>
</tr>
<tr>
<td>recvWindow</td>
<td>LONG</td>
<td>NO</td>
<td></td>
</tr>
<tr>
<td>timestamp</td>
<td>LONG</td>
<td>YES</td>
<td></td>
</tr>
</tbody></table>
<h2 id="user_data-11">用户手续费率 (USER_DATA)</h2>
<blockquote>
<p><strong>响应:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">{</span>
    <span class="s2">"symbol"</span><span class="p">:</span> <span class="s2">"BTCUSDT"</span><span class="p">,</span>
    <span class="s2">"makerCommissionRate"</span><span class="p">:</span> <span class="s2">"0.0002"</span><span class="p">,</span>  <span class="c1">// 0.02%</span>
    <span class="s2">"takerCommissionRate"</span><span class="p">:</span> <span class="s2">"0.0004"</span>   <span class="c1">// 0.04%</span>
<span class="p">}</span>
</code></pre>
<p><code>
GET /fapi/v1/commissionRate (HMAC SHA256)
</code></p>

<p><strong>权重:</strong>
20</p>

<p><strong>参数:</strong></p>

<table><thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必需</th>
<th>描述</th>
</tr>
</thead><tbody>
<tr>
<td>symbol</td>
<td>STRING</td>
<td>YES</td>
<td></td>
</tr>
<tr>
<td>recvWindow</td>
<td>LONG</td>
<td>NO</td>
<td></td>
</tr>
<tr>
<td>timestamp</td>
<td>LONG</td>
<td>YES</td>
<td></td>
</tr>
</tbody></table>
<h1 id="websocket-2">Websocket 账户信息推送</h1>
<ul>
<li>本篇所列出REST接口的baseurl <strong>https://fapi.binance.com</strong></li>
<li>用于订阅账户数据的 <code>listenKey</code> 从创建时刻起有效期为60分钟</li>
<li>可以通过<code>PUT</code>一个<code>listenKey</code>延长60分钟有效期</li>
<li>可以通过<code>DELETE</code>一个 <code>listenKey</code> 立即关闭当前数据流，并使该<code>listenKey</code> 无效</li>
<li>在具有有效<code>listenKey</code>的帐户上执行<code>POST</code>将返回当前有效的<code>listenKey</code>并将其有效期延长60分钟</li>
<li>本篇所列出的websocket接口baseurl: <strong>wss://fstream.binance.com</strong></li>
<li>订阅账户数据流的stream名称为 <strong>/ws/&lt;listenKey&gt;</strong></li>
<li>每个链接有效期不超过24小时，请妥善处理断线重连。</li>
<li>账户数据流的消息<strong>不保证</strong>严格时间序; <strong>请使用 E 字段进行排序</strong></li>
<li>考虑到剧烈行情下, RESTful接口可能存在查询延迟，我们强烈建议您优先从Websocket user data stream推送的消息来获取订单，仓位等信息。</li>
</ul>
<h2 id="listenkey-user_stream">生成listenKey (USER_STREAM)</h2>
<blockquote>
<p><strong>响应:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">{</span>
  <span class="s2">"listenKey"</span><span class="p">:</span> <span class="s2">"pqia91ma19a5s61cv6a81va65sdf19v8a65a1a5s61cv6a81va65sdf19v8a65a1"</span>
<span class="p">}</span>
</code></pre>
<p><code>
POST /fapi/v1/listenKey
</code></p>

<p>创建一个新的user data stream，返回值为一个listenKey，即websocket订阅的stream名称。如果该帐户具有有效的<code>listenKey</code>，则将返回该<code>listenKey</code>并将其有效期延长60分钟。</p>

<p><strong>权重:</strong>
1</p>

<p><strong>参数:</strong></p>

<p>None</p>
<h2 id="listenkey-user_stream-2">延长listenKey有效期 (USER_STREAM)</h2>
<blockquote>
<p><strong>响应:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">{}</span>
</code></pre>
<p><code>
PUT /fapi/v1/listenKey
</code></p>

<p>有效期延长至本次调用后60分钟</p>

<p><strong>权重:</strong>
1</p>

<p><strong>参数:</strong></p>

<p>None</p>
<h2 id="listenkey-user_stream-3">关闭listenKey (USER_STREAM)</h2>
<blockquote>
<p><strong>响应:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">{}</span>
</code></pre>
<p><code>
DELETE /fapi/v1/listenKey
</code></p>

<p>关闭某账户数据流</p>

<p><strong>权重:</strong>
1</p>

<p><strong>参数:</strong></p>

<p>None</p>
<h2 id="listenkey">listenKey 过期推送</h2>
<blockquote>
<p><strong>Payload:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">{</span>
    <span class="s1">'e'</span><span class="p">:</span> <span class="s1">'listenKeyExpired'</span><span class="p">,</span>      <span class="c1">// 事件类型</span>
    <span class="s1">'E'</span><span class="p">:</span> <span class="mi">1576653824250</span>              <span class="c1">// 事件时间</span>
<span class="p">}</span>
</code></pre>
<p>当前连接使用的有效listenKey过期时，user data stream 将会推送此事件。</p>

<p><strong>注意:</strong></p>

<ul>
<li>此事件与websocket连接中断没有必然联系</li>
<li>只有正在连接中的有效<code>listenKey</code>过期时才会收到此消息</li>
<li>收到此消息后user data stream将不再更新，直到用户使用新的有效的<code>listenKey</code></li>
</ul>
<h2 id="145a4121d8">追加保证金通知</h2>
<blockquote>
<p><strong>Payload:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">{</span>
    <span class="s2">"e"</span><span class="p">:</span><span class="s2">"MARGIN_CALL"</span><span class="p">,</span>      <span class="c1">// 事件类型</span>
    <span class="s2">"E"</span><span class="p">:</span><span class="mi">1587727187525</span><span class="p">,</span>      <span class="c1">// 事件时间</span>
    <span class="s2">"cw"</span><span class="p">:</span><span class="s2">"3.16812045"</span><span class="p">,</span>      <span class="c1">// 除去逐仓仓位保证金的钱包余额, 仅在全仓 margin call 情况下推送此字段</span>
    <span class="s2">"p"</span><span class="p">:[</span>                   <span class="c1">// 涉及持仓</span>
      <span class="p">{</span>
        <span class="s2">"s"</span><span class="p">:</span><span class="s2">"ETHUSDT"</span><span class="p">,</span>      <span class="c1">// symbol</span>
        <span class="s2">"ps"</span><span class="p">:</span><span class="s2">"LONG"</span><span class="p">,</span>        <span class="c1">// 持仓方向</span>
        <span class="s2">"pa"</span><span class="p">:</span><span class="s2">"1.327"</span><span class="p">,</span>       <span class="c1">// 仓位</span>
        <span class="s2">"mt"</span><span class="p">:</span><span class="s2">"CROSSED"</span><span class="p">,</span>     <span class="c1">// 保证金模式</span>
        <span class="s2">"iw"</span><span class="p">:</span><span class="s2">"0"</span><span class="p">,</span>           <span class="c1">// 若为逐仓，仓位保证金</span>
        <span class="s2">"mp"</span><span class="p">:</span><span class="s2">"187.17127"</span><span class="p">,</span>   <span class="c1">// 标记价格</span>
        <span class="s2">"up"</span><span class="p">:</span><span class="s2">"-1.166074"</span><span class="p">,</span>   <span class="c1">// 未实现盈亏</span>
        <span class="s2">"mm"</span><span class="p">:</span><span class="s2">"1.614445"</span>     <span class="c1">// 持仓需要的维持保证金</span>
      <span class="p">}</span>
    <span class="p">]</span>
<span class="p">}</span>  

</code></pre>
<ul>
<li>当用户持仓风险过高，会推送此消息。</li>
<li>此消息仅作为风险指导信息，不建议用于投资策略。</li>
<li>在大波动市场行情下,不排除此消息发出的同时用户仓位已被强平的可能。</li>
</ul>
<h2 id="balance-position">Balance和Position更新推送</h2>
<blockquote>
<p><strong>Payload:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">{</span>
  <span class="s2">"e"</span><span class="p">:</span> <span class="s2">"ACCOUNT_UPDATE"</span><span class="p">,</span>                <span class="c1">// 事件类型</span>
  <span class="s2">"E"</span><span class="p">:</span> <span class="mi">1564745798939</span><span class="p">,</span>                   <span class="c1">// 事件时间</span>
  <span class="s2">"T"</span><span class="p">:</span> <span class="mi">1564745798938</span> <span class="p">,</span>                  <span class="c1">// 撮合时间</span>
  <span class="s2">"a"</span><span class="p">:</span>                                  <span class="c1">// 账户更新事件</span>
    <span class="p">{</span>
      <span class="s2">"m"</span><span class="p">:</span><span class="s2">"ORDER"</span><span class="p">,</span>                      <span class="c1">// 事件推出原因 </span>
      <span class="s2">"B"</span><span class="p">:[</span>                             <span class="c1">// 余额信息</span>
        <span class="p">{</span>
          <span class="s2">"a"</span><span class="p">:</span><span class="s2">"USDT"</span><span class="p">,</span>                   <span class="c1">// 资产名称</span>
          <span class="s2">"wb"</span><span class="p">:</span><span class="s2">"122624.12345678"</span><span class="p">,</span>       <span class="c1">// 钱包余额</span>
          <span class="s2">"cw"</span><span class="p">:</span><span class="s2">"100.12345678"</span><span class="p">,</span>          <span class="c1">// 除去逐仓仓位保证金的钱包余额</span>
          <span class="s2">"bc"</span><span class="p">:</span><span class="s2">"50.12345678"</span>            <span class="c1">// 除去盈亏与交易手续费以外的钱包余额改变量</span>
        <span class="p">},</span>
        <span class="p">{</span>
          <span class="s2">"a"</span><span class="p">:</span><span class="s2">"BUSD"</span><span class="p">,</span>           
          <span class="s2">"wb"</span><span class="p">:</span><span class="s2">"1.00000000"</span><span class="p">,</span>
          <span class="s2">"cw"</span><span class="p">:</span><span class="s2">"0.00000000"</span><span class="p">,</span>         
          <span class="s2">"bc"</span><span class="p">:</span><span class="s2">"-49.12345678"</span>
        <span class="p">}</span>
      <span class="p">],</span>
      <span class="s2">"P"</span><span class="p">:[</span>
       <span class="p">{</span>
          <span class="s2">"s"</span><span class="p">:</span><span class="s2">"BTCUSDT"</span><span class="p">,</span>            <span class="c1">// 交易对</span>
          <span class="s2">"pa"</span><span class="p">:</span><span class="s2">"0"</span><span class="p">,</span>                 <span class="c1">// 仓位</span>
          <span class="s2">"ep"</span><span class="p">:</span><span class="s2">"0.00000"</span><span class="p">,</span>            <span class="c1">// 入仓价格</span>
          <span class="s2">"cr"</span><span class="p">:</span><span class="s2">"200"</span><span class="p">,</span>               <span class="c1">// (费前)累计实现损益</span>
          <span class="s2">"up"</span><span class="p">:</span><span class="s2">"0"</span><span class="p">,</span>                     <span class="c1">// 持仓未实现盈亏</span>
          <span class="s2">"mt"</span><span class="p">:</span><span class="s2">"isolated"</span><span class="p">,</span>              <span class="c1">// 保证金模式</span>
          <span class="s2">"iw"</span><span class="p">:</span><span class="s2">"0.00000000"</span><span class="p">,</span>            <span class="c1">// 若为逐仓，仓位保证金</span>
          <span class="s2">"ps"</span><span class="p">:</span><span class="s2">"BOTH"</span>                   <span class="c1">// 持仓方向</span>
       <span class="p">}</span><span class="err">，</span>
       <span class="p">{</span>
            <span class="s2">"s"</span><span class="p">:</span><span class="s2">"BTCUSDT"</span><span class="p">,</span>
            <span class="s2">"pa"</span><span class="p">:</span><span class="s2">"20"</span><span class="p">,</span>
            <span class="s2">"ep"</span><span class="p">:</span><span class="s2">"6563.66500"</span><span class="p">,</span>
            <span class="s2">"cr"</span><span class="p">:</span><span class="s2">"0"</span><span class="p">,</span>
            <span class="s2">"up"</span><span class="p">:</span><span class="s2">"2850.21200"</span><span class="p">,</span>
            <span class="s2">"mt"</span><span class="p">:</span><span class="s2">"isolated"</span><span class="p">,</span>
            <span class="s2">"iw"</span><span class="p">:</span><span class="s2">"13200.70726908"</span><span class="p">,</span>
            <span class="s2">"ps"</span><span class="p">:</span><span class="s2">"LONG"</span>
         <span class="p">},</span>
       <span class="p">{</span>
            <span class="s2">"s"</span><span class="p">:</span><span class="s2">"BTCUSDT"</span><span class="p">,</span>
            <span class="s2">"pa"</span><span class="p">:</span><span class="s2">"-10"</span><span class="p">,</span>
            <span class="s2">"ep"</span><span class="p">:</span><span class="s2">"6563.86000"</span><span class="p">,</span>
            <span class="s2">"cr"</span><span class="p">:</span><span class="s2">"-45.04000000"</span><span class="p">,</span>
            <span class="s2">"up"</span><span class="p">:</span><span class="s2">"-1423.15600"</span><span class="p">,</span>
            <span class="s2">"mt"</span><span class="p">:</span><span class="s2">"isolated"</span><span class="p">,</span>
            <span class="s2">"iw"</span><span class="p">:</span><span class="s2">"6570.42511771"</span><span class="p">,</span>
            <span class="s2">"ps"</span><span class="p">:</span><span class="s2">"SHORT"</span>
       <span class="p">}</span>
      <span class="p">]</span>
    <span class="p">}</span>
<span class="p">}</span>
</code></pre>
<p>账户更新事件的 event type 固定为 <code>ACCOUNT_UPDATE</code></p>

<ul>
<li><p>当账户信息有变动时，会推送此事件：</p>

<ul>
<li>仅当账户信息有变动时(包括资金、仓位、保证金模式等发生变化)，才会推送此事件；</li>
<li>订单状态变化没有引起账户和持仓变化的，不会推送此事件；</li>
<li>每次因持仓变动推送的position 信息，仅包含当前持仓不为0或逐仓仓位保证金不为0的symbol position。</li>
</ul></li>
<li><p>"FUNDING FEE" 引起的资金余额变化，仅推送简略事件：</p>

<ul>
<li>当用户某<strong>全仓</strong>持仓发生"FUNDING FEE"时，事件<code>ACCOUNT_UPDATE</code>将只会推送相关的用户资产余额信息<code>B</code>(仅推送FUNDING FEE 发生相关的资产余额信息)，而不会推送任何持仓信息<code>P</code>。</li>
<li>当用户某<strong>逐仓</strong>仓持仓发生"FUNDING FEE"时，事件<code>ACCOUNT_UPDATE</code>将只会推送相关的用户资产余额信息<code>B</code>(仅推送"FUNDING FEE"所使用的资产余额信息)，和相关的持仓信息<code>P</code>(仅推送这笔"FUNDING FEE"发生所在的持仓信息)，其余持仓信息不会被推送。</li>
</ul></li>
<li><p>字段"m"代表了事件推出的原因，包含了以下可能类型:</p>

<ul>
<li>DEPOSIT</li>
<li>WITHDRAW</li>
<li>ORDER</li>
<li>FUNDING_FEE</li>
<li>WITHDRAW_REJECT</li>
<li>ADJUSTMENT</li>
<li>INSURANCE_CLEAR</li>
<li>ADMIN_DEPOSIT</li>
<li>ADMIN_WITHDRAW</li>
<li>MARGIN_TRANSFER</li>
<li>MARGIN_TYPE_CHANGE</li>
<li>ASSET_TRANSFER</li>
<li>OPTIONS_PREMIUM_FEE</li>
<li>OPTIONS_SETTLE_PROFIT</li>
<li>AUTO_EXCHANGE</li>
</ul></li>
<li><p>字段"bc"代表了钱包余额的改变量，即 balance change，但注意其不包含仓位盈亏及交易手续费。</p></li>
</ul>
<h2 id="060a012f0b">订单/交易 更新推送</h2>
<blockquote>
<p><strong>Payload:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">{</span>

  <span class="s2">"e"</span><span class="p">:</span><span class="s2">"ORDER_TRADE_UPDATE"</span><span class="p">,</span>         <span class="c1">// 事件类型</span>
  <span class="s2">"E"</span><span class="p">:</span><span class="mi">1568879465651</span><span class="p">,</span>                <span class="c1">// 事件时间</span>
  <span class="s2">"T"</span><span class="p">:</span><span class="mi">1568879465650</span><span class="p">,</span>                <span class="c1">// 撮合时间</span>
  <span class="s2">"o"</span><span class="p">:{</span>                             
    <span class="s2">"s"</span><span class="p">:</span><span class="s2">"BTCUSDT"</span><span class="p">,</span>                  <span class="c1">// 交易对</span>
    <span class="s2">"c"</span><span class="p">:</span><span class="s2">"TEST"</span><span class="p">,</span>                     <span class="c1">// 客户端自定订单ID</span>
      <span class="c1">// 特殊的自定义订单ID:</span>
      <span class="c1">// "autoclose-"开头的字符串: 系统强平订单</span>
      <span class="c1">// "adl_autoclose": ADL自动减仓订单</span>
    <span class="s2">"S"</span><span class="p">:</span><span class="s2">"SELL"</span><span class="p">,</span>                     <span class="c1">// 订单方向</span>
    <span class="s2">"o"</span><span class="p">:</span><span class="s2">"TRAILING_STOP_MARKET"</span><span class="p">,</span> <span class="c1">// 订单类型</span>
    <span class="s2">"f"</span><span class="p">:</span><span class="s2">"GTC"</span><span class="p">,</span>                      <span class="c1">// 有效方式</span>
    <span class="s2">"q"</span><span class="p">:</span><span class="s2">"0.001"</span><span class="p">,</span>                    <span class="c1">// 订单原始数量</span>
    <span class="s2">"p"</span><span class="p">:</span><span class="s2">"0"</span><span class="p">,</span>                        <span class="c1">// 订单原始价格</span>
    <span class="s2">"ap"</span><span class="p">:</span><span class="s2">"0"</span><span class="p">,</span>                       <span class="c1">// 订单平均价格</span>
    <span class="s2">"sp"</span><span class="p">:</span><span class="s2">"7103.04"</span><span class="p">,</span>                 <span class="c1">// 条件订单触发价格，对追踪止损单无效</span>
    <span class="s2">"x"</span><span class="p">:</span><span class="s2">"NEW"</span><span class="p">,</span>                      <span class="c1">// 本次事件的具体执行类型</span>
    <span class="s2">"X"</span><span class="p">:</span><span class="s2">"NEW"</span><span class="p">,</span>                      <span class="c1">// 订单的当前状态</span>
    <span class="s2">"i"</span><span class="p">:</span><span class="mi">8886774</span><span class="p">,</span>                    <span class="c1">// 订单ID</span>
    <span class="s2">"l"</span><span class="p">:</span><span class="s2">"0"</span><span class="p">,</span>                        <span class="c1">// 订单末次成交量</span>
    <span class="s2">"z"</span><span class="p">:</span><span class="s2">"0"</span><span class="p">,</span>                        <span class="c1">// 订单累计已成交量</span>
    <span class="s2">"L"</span><span class="p">:</span><span class="s2">"0"</span><span class="p">,</span>                        <span class="c1">// 订单末次成交价格</span>
    <span class="s2">"N"</span><span class="p">:</span> <span class="s2">"USDT"</span><span class="p">,</span>                    <span class="c1">// 手续费资产类型</span>
    <span class="s2">"n"</span><span class="p">:</span> <span class="s2">"0"</span><span class="p">,</span>                       <span class="c1">// 手续费数量</span>
    <span class="s2">"T"</span><span class="p">:</span><span class="mi">1568879465651</span><span class="p">,</span>              <span class="c1">// 成交时间</span>
    <span class="s2">"t"</span><span class="p">:</span><span class="mi">0</span><span class="p">,</span>                          <span class="c1">// 成交ID</span>
    <span class="s2">"b"</span><span class="p">:</span><span class="s2">"0"</span><span class="p">,</span>                        <span class="c1">// 买单净值</span>
    <span class="s2">"a"</span><span class="p">:</span><span class="s2">"9.91"</span><span class="p">,</span>                     <span class="c1">// 卖单净值</span>
    <span class="s2">"m"</span><span class="p">:</span> <span class="kc">false</span><span class="p">,</span>                     <span class="c1">// 该成交是作为挂单成交吗？</span>
    <span class="s2">"R"</span><span class="p">:</span><span class="kc">false</span>   <span class="p">,</span>                   <span class="c1">// 是否是只减仓单</span>
    <span class="s2">"wt"</span><span class="p">:</span> <span class="s2">"CONTRACT_PRICE"</span><span class="p">,</span>         <span class="c1">// 触发价类型</span>
    <span class="s2">"ot"</span><span class="p">:</span> <span class="s2">"TRAILING_STOP_MARKET"</span><span class="p">,</span>   <span class="c1">// 原始订单类型</span>
    <span class="s2">"ps"</span><span class="p">:</span><span class="s2">"LONG"</span>                     <span class="c1">// 持仓方向</span>
    <span class="s2">"cp"</span><span class="p">:</span><span class="kc">false</span><span class="p">,</span>                     <span class="c1">// 是否为触发平仓单; 仅在条件订单情况下会推送此字段</span>
    <span class="s2">"AP"</span><span class="p">:</span><span class="s2">"7476.89"</span><span class="p">,</span>                 <span class="c1">// 追踪止损激活价格, 仅在追踪止损单时会推送此字段</span>
    <span class="s2">"cr"</span><span class="p">:</span><span class="s2">"5.0"</span><span class="p">,</span>                     <span class="c1">// 追踪止损回调比例, 仅在追踪止损单时会推送此字段</span>
    <span class="s2">"rp"</span><span class="p">:</span><span class="s2">"0"</span>                            <span class="c1">// 该交易实现盈亏</span>

  <span class="p">}</span>

<span class="p">}</span>
</code></pre>
<p>当有新订单创建、订单有新成交或者新的状态变化时会推送此类事件
事件类型统一为 <code>ORDER_TRADE_UPDATE</code></p>

<p><strong>订单方向</strong></p>

<ul>
<li>BUY 买入</li>
<li>SELL 卖出</li>
</ul>

<p><strong>订单类型</strong></p>

<ul>
<li>MARKET  市价单</li>
<li>LIMIT 限价单</li>
<li>STOP      止损单</li>
<li>TAKE_PROFIT 止盈单</li>
<li>LIQUIDATION 强平单</li>
</ul>

<p><strong>本次事件的具体执行类型</strong></p>

<ul>
<li>NEW</li>
<li>CANCELED      已撤</li>
<li>CALCULATED<br></li>
<li>EXPIRED           订单失效</li>
<li>TRADE         交易</li>
</ul>

<p><strong>订单状态</strong></p>

<ul>
<li>NEW</li>
<li>PARTIALLY_FILLED<br></li>
<li>FILLED</li>
<li>CANCELED</li>
<li>EXPIRED</li>
<li>NEW_INSURANCE     风险保障基金(强平)</li>
<li>NEW_ADL               自动减仓序列(强平)</li>
</ul>

<p><strong>有效方式:</strong></p>

<ul>
<li>GTC </li>
<li>IOC</li>
<li>FOK</li>
<li>GTX</li>
</ul>
<h2 id="c7d7476989">杠杆倍数等账户配置 更新推送</h2>
<blockquote>
<p><strong>Payload:</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">{</span>
    <span class="s2">"e"</span><span class="p">:</span><span class="s2">"ACCOUNT_CONFIG_UPDATE"</span><span class="p">,</span>       <span class="c1">// 事件类型</span>
    <span class="s2">"E"</span><span class="p">:</span><span class="mi">1611646737479</span><span class="p">,</span>                 <span class="c1">// 事件时间</span>
    <span class="s2">"T"</span><span class="p">:</span><span class="mi">1611646737476</span><span class="p">,</span>                 <span class="c1">// 撮合时间</span>
    <span class="s2">"ac"</span><span class="p">:{</span>                              
    <span class="s2">"s"</span><span class="p">:</span><span class="s2">"BTCUSDT"</span><span class="p">,</span>                     <span class="c1">// 交易对</span>
    <span class="s2">"l"</span><span class="p">:</span><span class="mi">25</span>                             <span class="c1">// 杠杆倍数</span>

    <span class="p">}</span>
<span class="p">}</span>  

</code></pre>
<blockquote>
<p><strong>Or</strong></p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">{</span>
    <span class="s2">"e"</span><span class="p">:</span><span class="s2">"ACCOUNT_CONFIG_UPDATE"</span><span class="p">,</span>       <span class="c1">// 事件类型</span>
    <span class="s2">"E"</span><span class="p">:</span><span class="mi">1611646737479</span><span class="p">,</span>                 <span class="c1">// 事件时间</span>
    <span class="s2">"T"</span><span class="p">:</span><span class="mi">1611646737476</span><span class="p">,</span>                 <span class="c1">// 撮合时间</span>
    <span class="s2">"ai"</span><span class="p">:{</span>                             <span class="c1">// 用户账户配置</span>
    <span class="s2">"j"</span><span class="p">:</span><span class="kc">true</span>                           <span class="c1">// 联合保证金状态</span>
    <span class="p">}</span>
<span class="p">}</span>  
</code></pre>
<p>当账户配置发生变化时会推送此类事件类型统一为<code>ACCOUNT_CONFIG_UPDATE</code></p>

<p>当交易对杠杆倍数发生变化时推送消息体会包含对象<code>ac</code>表示交易对账户配置，其中<code>s</code>代表具体的交易对，<code>l</code>代表杠杆倍数</p>

<p>当用户联合保证金状态发生变化时推送消息体会包含对象<code>ai</code>表示用户账户配置，其中<code>j</code>代表用户联合保证金状态</p>
<h1 id="cf68bca02a">错误代码</h1>
<blockquote>
<p>error JSON payload:</p>
</blockquote>
<pre class="highlight javascript tab-javascript"><code><span class="p">{</span>
  <span class="s2">"code"</span><span class="p">:</span><span class="o">-</span><span class="mi">1121</span><span class="p">,</span>
  <span class="s2">"msg"</span><span class="p">:</span><span class="s2">"Invalid symbol."</span>
<span class="p">}</span>
</code></pre>
<p>错误由两部分组成：错误代码和消息。 代码是通用的，但是消息可能会有所不同。</p>
<h2 id="10xx">10xx - 常规服务器或网络问题</h2><h3 id="1000-unknown">-1000 UNKNOWN</h3>
<ul>
<li>An unknown error occured while processing the request.</li>
<li>处理请求时发生未知错误。</li>
</ul>
<h3 id="1001-disconnected">-1001 DISCONNECTED</h3>
<ul>
<li>Internal error; unable to process your request. Please try again.</li>
<li>内部错误; 无法处理您的请求。 请再试一次.</li>
</ul>
<h3 id="1002-unauthorized">-1002 UNAUTHORIZED</h3>
<ul>
<li>You are not authorized to execute this request.</li>
<li>您无权执行此请求。</li>
</ul>
<h3 id="1003-too_many_requests">-1003 TOO_MANY_REQUESTS</h3>
<ul>
<li>Too many requests queued.</li>
<li>排队的请求过多。</li>
<li>Too many requests; please use the websocket for live updates.</li>
<li>请求权重过多； 请使用websocket获取最新更新。</li>
<li>Too many requests; current limit is %s requests per minute. Please use the websocket for live updates to avoid polling the API.</li>
<li>请求权重过多； 当前限制为每分钟％s请求权重。 请使用websocket进行实时更新，以避免轮询API。</li>
<li>Way too many requests; IP banned until %s. Please use the websocket for live updates to avoid bans.</li>
<li>请求权重过多； IP被禁止，直到％s。 请使用websocket进行实时更新，以免被禁。</li>
</ul>
<h3 id="1004-duplicate_ip">-1004 DUPLICATE_IP</h3>
<ul>
<li>This IP is already on the white list</li>
<li>IP地址已经在白名单</li>
</ul>
<h3 id="1005-no_such_ip">-1005 NO_SUCH_IP</h3>
<ul>
<li>No such IP has been white listed</li>
<li>白名单上没有此IP地址</li>
</ul>
<h3 id="1006-unexpected_resp">-1006 UNEXPECTED_RESP</h3>
<ul>
<li>An unexpected response was received from the message bus. Execution status unknown.</li>
<li>从消息总线收到意外的响应。执行状态未知。</li>
</ul>
<h3 id="1007-timeout">-1007 TIMEOUT</h3>
<ul>
<li>Timeout waiting for response from backend server. Send status unknown; execution status unknown.</li>
<li>等待后端服务器响应超时。 发送状态未知； 执行状态未知。</li>
</ul>
<h3 id="1014-unknown_order_composition">-1014 UNKNOWN_ORDER_COMPOSITION</h3>
<ul>
<li>Unsupported order combination.</li>
<li>不支持当前的下单参数组合</li>
</ul>
<h3 id="1015-too_many_orders">-1015 TOO_MANY_ORDERS</h3>
<ul>
<li>Too many new orders.</li>
<li>新订单太多。</li>
<li>Too many new orders; current limit is %s orders per %s.
&nbsp;* 新订单太多； 当前限制为每％s ％s个订单。</li>
</ul>
<h3 id="1016-service_shutting_down">-1016 SERVICE_SHUTTING_DOWN</h3>
<ul>
<li>This service is no longer available.</li>
<li>该服务不可用。</li>
</ul>
<h3 id="1020-unsupported_operation">-1020 UNSUPPORTED_OPERATION</h3>
<ul>
<li>This operation is not supported.</li>
<li>不支持此操作。</li>
</ul>
<h3 id="1021-invalid_timestamp">-1021 INVALID_TIMESTAMP</h3>
<ul>
<li>Timestamp for this request is outside of the recvWindow.

<ul>
<li>此请求的时间戳在recvWindow之外。</li>
</ul></li>
<li>Timestamp for this request was 1000ms ahead of the server's time.
&nbsp;* 此请求的时间戳比服务器时间提前1000毫秒。</li>
</ul>
<h3 id="1022-invalid_signature">-1022 INVALID_SIGNATURE</h3>
<ul>
<li>Signature for this request is not valid.</li>
<li>此请求的签名无效。</li>
</ul>
<h3 id="1023-start_time_greater_than_end_time">-1023 START_TIME_GREATER_THAN_END_TIME</h3>
<ul>
<li>Start time is greater than end time.</li>
<li>参数里面的开始时间在结束时间之后</li>
</ul>
<h2 id="11xx-request-issues">11xx - Request issues</h2><h3 id="1100-illegal_chars">-1100 ILLEGAL_CHARS</h3>
<ul>
<li>Illegal characters found in a parameter.</li>
<li>在参数中发现非法字符。</li>
<li>Illegal characters found in parameter '%s'; legal range is '%s'.</li>
<li>在参数<code>％s</code>中发现非法字符； 合法范围是<code>％s</code>。</li>
</ul>
<h3 id="1101-too_many_parameters">-1101 TOO_MANY_PARAMETERS</h3>
<ul>
<li>Too many parameters sent for this endpoint.</li>
<li>为此端点发送的参数太多。</li>
<li>Too many parameters; expected '%s' and received '%s'.</li>
<li>参数太多；预期为<code>％s</code>并收到了<code>％s</code>。</li>
<li>Duplicate values for a parameter detected.
&nbsp;* 检测到的参数值重复。</li>
</ul>
<h3 id="1102-mandatory_param_empty_or_malformed">-1102 MANDATORY_PARAM_EMPTY_OR_MALFORMED</h3>
<ul>
<li>A mandatory parameter was not sent, was empty/null, or malformed.</li>
<li>未发送强制性参数，该参数为空/空或格式错误。</li>
<li>Mandatory parameter '%s' was not sent, was empty/null, or malformed.
&nbsp;* 强制参数<code>％s</code>未发送，为空/空或格式错误。</li>
<li>Param '%s' or '%s' must be sent, but both were empty/null!
&nbsp;* 必须发送参数<code>％s</code>或<code>％s</code>，但两者均为空！</li>
</ul>
<h3 id="1103-unknown_param">-1103 UNKNOWN_PARAM</h3>
<ul>
<li>An unknown parameter was sent.</li>
<li>发送了未知参数。</li>
</ul>
<h3 id="1104-unread_parameters">-1104 UNREAD_PARAMETERS</h3>
<ul>
<li>Not all sent parameters were read.</li>
<li>并非所有发送的参数都被读取。</li>
<li>Not all sent parameters were read; read '%s' parameter(s) but was sent '%s'.</li>
<li>并非所有发送的参数都被读取； 读取了<code>％s</code>参数，但被发送了<code>％s</code>。</li>
</ul>
<h3 id="1105-param_empty">-1105 PARAM_EMPTY</h3>
<ul>
<li>A parameter was empty.</li>
<li>参数为空。</li>
<li>Parameter '%s' was empty.</li>
<li>参数<code>％s</code>为空。</li>
</ul>
<h3 id="1106-param_not_required">-1106 PARAM_NOT_REQUIRED</h3>
<ul>
<li>A parameter was sent when not required.</li>
<li>发送了不需要的参数。</li>
<li>Parameter '%s' sent when not required.</li>
<li>发送了不需要参数<code>％s</code>。</li>
</ul>
<h3 id="1111-bad_precision">-1111 BAD_PRECISION</h3>
<ul>
<li>Precision is over the maximum defined for this asset.</li>
<li>精度超过为此资产定义的最大值。</li>
</ul>
<h3 id="1112-no_depth">-1112 NO_DEPTH</h3>
<ul>
<li>No orders on book for symbol.</li>
<li>交易对没有挂单。</li>
</ul>
<h3 id="1114-tif_not_required">-1114 TIF_NOT_REQUIRED</h3>
<ul>
<li>TimeInForce parameter sent when not required.</li>
<li>发送的<code>TimeInForce</code>参数不需要。</li>
</ul>
<h3 id="1115-invalid_tif">-1115 INVALID_TIF</h3>
<ul>
<li>Invalid timeInForce.</li>
<li>无效的<code>timeInForce</code></li>
</ul>
<h3 id="1116-invalid_order_type">-1116 INVALID_ORDER_TYPE</h3>
<ul>
<li>Invalid orderType.</li>
<li>无效订单类型。</li>
</ul>
<h3 id="1117-invalid_side">-1117 INVALID_SIDE</h3>
<ul>
<li>Invalid side.</li>
<li>无效买卖方向。</li>
</ul>
<h3 id="1118-empty_new_cl_ord_id">-1118 EMPTY_NEW_CL_ORD_ID</h3>
<ul>
<li>New client order ID was empty.</li>
<li>新的客户订单ID为空。</li>
</ul>
<h3 id="1119-empty_org_cl_ord_id">-1119 EMPTY_ORG_CL_ORD_ID</h3>
<ul>
<li>Original client order ID was empty.</li>
<li>客户自定义的订单ID为空。</li>
</ul>
<h3 id="1120-bad_interval">-1120 BAD_INTERVAL</h3>
<ul>
<li>Invalid interval.</li>
<li>无效时间间隔。</li>
</ul>
<h3 id="1121-bad_symbol">-1121 BAD_SYMBOL</h3>
<ul>
<li>Invalid symbol.</li>
<li>无效的交易对。</li>
</ul>
<h3 id="1125-invalid_listen_key">-1125 INVALID_LISTEN_KEY</h3>
<ul>
<li>This listenKey does not exist.</li>
<li>此<code>listenKey</code>不存在。</li>
</ul>
<h3 id="1127-more_than_xx_hours">-1127 MORE_THAN_XX_HOURS</h3>
<ul>
<li>Lookup interval is too big.</li>
<li>查询间隔太大。</li>
<li>More than %s hours between startTime and endTime.</li>
<li>从开始时间到结束时间之间超过<code>％s</code>小时。</li>
</ul>
<h3 id="1128-optional_params_bad_combo">-1128 OPTIONAL_PARAMS_BAD_COMBO</h3>
<ul>
<li>Combination of optional parameters invalid.</li>
<li>可选参数组合无效。</li>
</ul>
<h3 id="1130-invalid_parameter">-1130 INVALID_PARAMETER</h3>
<ul>
<li>Invalid data sent for a parameter.</li>
<li>发送的参数为无效数据。</li>
<li>Data sent for paramter '%s' is not valid.</li>
<li>发送参数<code>％s</code>的数据无效。</li>
</ul>
<h3 id="1136-invalid_new_order_resp_type">-1136 INVALID_NEW_ORDER_RESP_TYPE</h3>
<ul>
<li>Invalid newOrderRespType.</li>
<li>无效的 newOrderRespType。</li>
</ul>
<h2 id="20xx-processing-issues">20xx - Processing Issues</h2><h3 id="2010-new_order_rejected">-2010 NEW_ORDER_REJECTED</h3>
<ul>
<li>NEW_ORDER_REJECTED</li>
<li>新订单被拒绝</li>
</ul>
<h3 id="2011-cancel_rejected">-2011 CANCEL_REJECTED</h3>
<ul>
<li>CANCEL_REJECTED</li>
<li>取消订单被拒绝</li>
</ul>
<h3 id="2013-no_such_order">-2013 NO_SUCH_ORDER</h3>
<ul>
<li>Order does not exist.</li>
<li>订单不存在。</li>
</ul>
<h3 id="2014-bad_api_key_fmt">-2014 BAD_API_KEY_FMT</h3>
<ul>
<li>API-key format invalid.</li>
<li>API-key 格式无效。</li>
</ul>
<h3 id="2015-rejected_mbx_key">-2015 REJECTED_MBX_KEY</h3>
<ul>
<li>Invalid API-key, IP, or permissions for action.</li>
<li>无效的API密钥，IP或操作权限。</li>
</ul>
<h3 id="2016-no_trading_window">-2016 NO_TRADING_WINDOW</h3>
<ul>
<li>No trading window could be found for the symbol. Try ticker/24hrs instead.</li>
<li>找不到该交易对的交易窗口。 尝试改为24小时自动报价。</li>
</ul>
<h3 id="2018-balance_not_sufficient">-2018 BALANCE_NOT_SUFFICIENT</h3>
<ul>
<li>Balance is insufficient.</li>
<li>余额不足</li>
</ul>
<h3 id="2019-margin_not_sufficien">-2019 MARGIN_NOT_SUFFICIEN</h3>
<ul>
<li>Margin is insufficient.</li>
<li>杠杆账户余额不足</li>
</ul>
<h3 id="2020-unable_to_fill">-2020 UNABLE_TO_FILL</h3>
<ul>
<li>Unable to fill.</li>
<li>无法成交</li>
</ul>
<h3 id="2021-order_would_immediately_trigger">-2021 ORDER_WOULD_IMMEDIATELY_TRIGGER</h3>
<ul>
<li>Order would immediately trigger.</li>
<li>订单可能被立刻触发</li>
</ul>
<h3 id="2022-reduce_only_reject">-2022 REDUCE_ONLY_REJECT</h3>
<ul>
<li>ReduceOnly Order is rejected.</li>
<li><code>ReduceOnly</code>订单被拒绝</li>
</ul>
<h3 id="2023-user_in_liquidation">-2023 USER_IN_LIQUIDATION</h3>
<ul>
<li>User in liquidation mode now.</li>
<li>用户正处于被强平模式</li>
</ul>
<h3 id="2024-position_not_sufficient">-2024 POSITION_NOT_SUFFICIENT</h3>
<ul>
<li>Position is not sufficient.</li>
<li>持仓不足</li>
</ul>
<h3 id="2025-max_open_order_exceeded">-2025 MAX_OPEN_ORDER_EXCEEDED</h3>
<ul>
<li>Reach max open order limit.</li>
<li>挂单量达到上限</li>
</ul>
<h3 id="2026-reduce_only_order_type_not_supported">-2026 REDUCE_ONLY_ORDER_TYPE_NOT_SUPPORTED</h3>
<ul>
<li>This OrderType is not supported when reduceOnly.</li>
<li>当前订单类型不支持<code>reduceOnly</code></li>
</ul>
<h3 id="2027-max_leverage_ratio">-2027 MAX_LEVERAGE_RATIO</h3>
<ul>
<li>Exceeded the maximum allowable position at current leverage.</li>
<li>挂单或持仓超出当前初始杠杆下的最大值</li>
</ul>
<h3 id="2028-min_leverage_ratio">-2028 MIN_LEVERAGE_RATIO</h3>
<ul>
<li>Leverage is smaller than permitted: insufficient margin balance.</li>
<li>调整初始杠杆过低，导致可用余额不足 </li>
</ul>
<h2 id="40xx-filters-and-other-issues">40xx - Filters and other Issues</h2><h3 id="4000-invalid_order_status">-4000 INVALID_ORDER_STATUS</h3>
<ul>
<li>Invalid order status.</li>
<li>订单状态不正确</li>
</ul>
<h3 id="4001-price_less_than_zero">-4001 PRICE_LESS_THAN_ZERO</h3>
<ul>
<li>Price less than 0.</li>
<li>价格小于0</li>
</ul>
<h3 id="4002-price_greater_than_max_price">-4002 PRICE_GREATER_THAN_MAX_PRICE</h3>
<ul>
<li>Price greater than max price.</li>
<li>价格超过最大值</li>
</ul>
<h3 id="4003-qty_less_than_zero">-4003 QTY_LESS_THAN_ZERO</h3>
<ul>
<li>Quantity less than zero.</li>
<li>数量小于0</li>
</ul>
<h3 id="4004-qty_less_than_min_qty">-4004 QTY_LESS_THAN_MIN_QTY</h3>
<ul>
<li>Quantity less than min quantity.</li>
<li>数量小于最小值</li>
</ul>
<h3 id="4005-qty_greater_than_max_qty">-4005 QTY_GREATER_THAN_MAX_QTY</h3>
<ul>
<li>Quantity greater than max quantity.</li>
<li>数量大于最大值</li>
</ul>
<h3 id="4006-stop_price_less_than_zero">-4006 STOP_PRICE_LESS_THAN_ZERO</h3>
<ul>
<li>Stop price less than zero. </li>
<li>触发价小于最小值</li>
</ul>
<h3 id="4007-stop_price_greater_than_max_price">-4007 STOP_PRICE_GREATER_THAN_MAX_PRICE</h3>
<ul>
<li>Stop price greater than max price.</li>
<li>触发价大于最大值</li>
</ul>
<h3 id="4008-tick_size_less_than_zero">-4008 TICK_SIZE_LESS_THAN_ZERO</h3>
<ul>
<li>Tick size less than zero.</li>
<li>价格精度小于0</li>
</ul>
<h3 id="4009-max_price_less_than_min_price">-4009 MAX_PRICE_LESS_THAN_MIN_PRICE</h3>
<ul>
<li>Max price less than min price.</li>
<li>最大价格小于最小价格</li>
</ul>
<h3 id="4010-max_qty_less_than_min_qty">-4010 MAX_QTY_LESS_THAN_MIN_QTY</h3>
<ul>
<li>Max qty less than min qty.</li>
<li>最大数量小于最小数量</li>
</ul>
<h3 id="4011-step_size_less_than_zero">-4011 STEP_SIZE_LESS_THAN_ZERO</h3>
<ul>
<li>Step size less than zero.</li>
<li>步进值小于0</li>
</ul>
<h3 id="4012-max_num_orders_less_than_zero">-4012 MAX_NUM_ORDERS_LESS_THAN_ZERO</h3>
<ul>
<li>Max num orders less than zero.</li>
<li>最大订单量小于0</li>
</ul>
<h3 id="4013-price_less_than_min_price">-4013 PRICE_LESS_THAN_MIN_PRICE</h3>
<ul>
<li>Price less than min price.</li>
<li>价格小于最小价格</li>
</ul>
<h3 id="4014-price_not_increased_by_tick_size">-4014 PRICE_NOT_INCREASED_BY_TICK_SIZE</h3>
<ul>
<li>Price not increased by tick size.</li>
<li>价格增量不是价格精度的倍数。</li>
</ul>
<h3 id="4015-invalid_cl_ord_id_len">-4015 INVALID_CL_ORD_ID_LEN</h3>
<ul>
<li>Client order id is not valid.</li>
<li>客户订单ID有误。</li>
<li>Client order id length should not be more than 36 chars</li>
<li>客户订单ID长度应该不多于36字符</li>
</ul>
<h3 id="4016-price_highter_than_multiplier_up">-4016 PRICE_HIGHTER_THAN_MULTIPLIER_UP</h3>
<ul>
<li>Price is higher than mark price multiplier cap.</li>
</ul>
<h3 id="4017-multiplier_up_less_than_zero">-4017 MULTIPLIER_UP_LESS_THAN_ZERO</h3>
<ul>
<li>Multiplier up less than zero.</li>
<li>价格上限小于0</li>
</ul>
<h3 id="4018-multiplier_down_less_than_zero">-4018 MULTIPLIER_DOWN_LESS_THAN_ZERO</h3>
<ul>
<li>Multiplier down less than zero.</li>
<li>价格下限小于0</li>
</ul>
<h3 id="4019-composite_scale_overflow">-4019 COMPOSITE_SCALE_OVERFLOW</h3>
<ul>
<li>Composite scale too large.</li>
</ul>
<h3 id="4020-target_strategy_invalid">-4020 TARGET_STRATEGY_INVALID</h3>
<ul>
<li>Target strategy invalid for orderType '%s',reduceOnly '%b'.</li>
<li>目标策略值不适合<code>%s</code>订单状态, 只减仓<code>%b</code>。</li>
</ul>
<h3 id="4021-invalid_depth_limit">-4021 INVALID_DEPTH_LIMIT</h3>
<ul>
<li>Invalid depth limit.</li>
<li>深度信息的<code>limit</code>值不正确。</li>
<li>'%s' is not valid depth limit.</li>
<li><code>%s</code>不是合理的深度信息的<code>limit</code>值。</li>
</ul>
<h3 id="4022-wrong_market_status">-4022 WRONG_MARKET_STATUS</h3>
<ul>
<li>market status sent is not valid.</li>
<li>发送的市场状态不正确。</li>
</ul>
<h3 id="4023-qty_not_increased_by_step_size">-4023 QTY_NOT_INCREASED_BY_STEP_SIZE</h3>
<ul>
<li>Qty not increased by step size.</li>
<li>数量的递增值不是步进值的倍数。</li>
</ul>
<h3 id="4024-price_lower_than_multiplier_down">-4024 PRICE_LOWER_THAN_MULTIPLIER_DOWN</h3>
<ul>
<li>Price is lower than mark price multiplier floor.</li>
</ul>
<h3 id="4025-multiplier_decimal_less_than_zero">-4025 MULTIPLIER_DECIMAL_LESS_THAN_ZERO</h3>
<ul>
<li>Multiplier decimal less than zero.</li>
</ul>
<h3 id="4026-commission_invalid">-4026 COMMISSION_INVALID</h3>
<ul>
<li>Commission invalid.</li>
<li>收益值不正确</li>
<li><code>%s</code> less than zero.</li>
<li><code>%s</code>少于0</li>
<li><code>%s</code> absolute value greater than <code>%s</code></li>
<li><code>%s</code>绝对值大于<code>%s</code></li>
</ul>
<h3 id="4027-invalid_account_type">-4027 INVALID_ACCOUNT_TYPE</h3>
<ul>
<li>Invalid account type.</li>
<li>账户类型不正确。</li>
</ul>
<h3 id="4028-invalid_leverage">-4028 INVALID_LEVERAGE</h3>
<ul>
<li>Invalid leverage</li>
<li>杠杆倍数不正确</li>
<li>Leverage <code>%s</code> is not valid</li>
<li>杠杆<code>%s</code>不正确</li>
<li>Leverage <code>%s</code> already exist with <code>%s</code></li>
<li>杠杆<code>%s</code>已经存在于<code>%s</code></li>
</ul>
<h3 id="4029-invalid_tick_size_precision">-4029 INVALID_TICK_SIZE_PRECISION</h3>
<ul>
<li>Tick size precision is invalid.</li>
<li>价格精度小数点位数不正确。</li>
</ul>
<h3 id="4030-invalid_step_size_precision">-4030 INVALID_STEP_SIZE_PRECISION</h3>
<ul>
<li>Step size precision is invalid.</li>
<li>步进值小数点位数不正确。</li>
</ul>
<h3 id="4031-invalid_working_type">-4031 INVALID_WORKING_TYPE</h3>
<ul>
<li>Invalid parameter working type</li>
<li>不正确的参数类型</li>
<li>Invalid parameter working type: <code>%s</code></li>
<li>不正确的参数类型: <code>%s</code></li>
</ul>
<h3 id="4032-exceed_max_cancel_order_size">-4032 EXCEED_MAX_CANCEL_ORDER_SIZE</h3>
<ul>
<li>Exceed maximum cancel order size.</li>
<li>超过可以取消的最大订单量。</li>
<li>Invalid parameter working type: <code>%s</code></li>
<li>不正确的参数类型: <code>%s</code></li>
</ul>
<h3 id="4033-insurance_account_not_found">-4033 INSURANCE_ACCOUNT_NOT_FOUND</h3>
<ul>
<li>Insurance account not found.</li>
<li>风险保障基金账号没找到。</li>
</ul>
<h3 id="4044-invalid_balance_type">-4044 INVALID_BALANCE_TYPE</h3>
<ul>
<li>Balance Type is invalid.</li>
<li>余额类型不正确。</li>
</ul>
<h3 id="4045-max_stop_order_exceeded">-4045 MAX_STOP_ORDER_EXCEEDED</h3>
<ul>
<li>Reach max stop order limit.</li>
<li>达到止损单的上限。</li>
</ul>
<h3 id="4046-no_need_to_change_margin_type">-4046 NO_NEED_TO_CHANGE_MARGIN_TYPE</h3>
<ul>
<li>No need to change margin type.</li>
<li>不需要切换仓位模式。</li>
</ul>
<h3 id="4047-there_exists_open_orders">-4047 THERE_EXISTS_OPEN_ORDERS</h3>
<ul>
<li>Margin type cannot be changed if there exists open orders.</li>
<li>如果有挂单，仓位模式不能切换。</li>
</ul>
<h3 id="4048-there_exists_quantity">-4048 THERE_EXISTS_QUANTITY</h3>
<ul>
<li>Margin type cannot be changed if there exists position.</li>
<li>如果有仓位，仓位模式不能切换。</li>
</ul>
<h3 id="4049-add_isolated_margin_reject">-4049 ADD_ISOLATED_MARGIN_REJECT</h3>
<ul>
<li>Add margin only support for isolated position.</li>
</ul>
<h3 id="4050-cross_balance_insufficient">-4050 CROSS_BALANCE_INSUFFICIENT</h3>
<ul>
<li>Cross balance insufficient.</li>
<li>全仓余额不足。</li>
</ul>
<h3 id="4051-isolated_balance_insufficient">-4051 ISOLATED_BALANCE_INSUFFICIENT</h3>
<ul>
<li>Isolated balance insufficient.</li>
<li>逐仓余额不足。</li>
</ul>
<h3 id="4052-no_need_to_change_auto_add_margin">-4052 NO_NEED_TO_CHANGE_AUTO_ADD_MARGIN</h3>
<ul>
<li>No need to change auto add margin.</li>
</ul>
<h3 id="4053-auto_add_crossed_margin_reject">-4053 AUTO_ADD_CROSSED_MARGIN_REJECT</h3>
<ul>
<li>Auto add margin only support for isolated position.</li>
<li>自动增加保证金只适用于逐仓。</li>
</ul>
<h3 id="4054-add_isolated_margin_no_position_reject">-4054 ADD_ISOLATED_MARGIN_NO_POSITION_REJECT</h3>
<ul>
<li>Cannot add position margin: position is 0.</li>
<li>不能增加逐仓保证金: 持仓为0</li>
</ul>
<h3 id="4055-amount_must_be_positive">-4055 AMOUNT_MUST_BE_POSITIVE</h3>
<ul>
<li>Amount must be positive.</li>
<li>数量必须是正整数</li>
</ul>
<h3 id="4056-invalid_api_key_type">-4056 INVALID_API_KEY_TYPE</h3>
<ul>
<li>Invalid api key type.</li>
<li>API key的类型不正确</li>
</ul>
<h3 id="4057-invalid_rsa_public_key">-4057 INVALID_RSA_PUBLIC_KEY</h3>
<ul>
<li>Invalid api public key</li>
<li>API key不正确</li>
</ul>
<h3 id="4058-max_price_too_large">-4058 MAX_PRICE_TOO_LARGE</h3>
<ul>
<li>maxPrice and priceDecimal too large,please check.</li>
<li>maxPrice和priceDecimal太大，请检查。</li>
</ul>
<h3 id="4059-no_need_to_change_position_side">-4059 NO_NEED_TO_CHANGE_POSITION_SIDE</h3>
<ul>
<li>No need to change position side.</li>
<li>无需变更仓位方向</li>
</ul>
<h3 id="4060-invalid_position_side">-4060 INVALID_POSITION_SIDE</h3>
<ul>
<li>Invalid position side.</li>
<li>仓位方向不正确。</li>
</ul>
<h3 id="4061-position_side_not_match">-4061 POSITION_SIDE_NOT_MATCH</h3>
<ul>
<li>Order's position side does not match user's setting.</li>
<li>订单的持仓方向和用户设置不一致。</li>
</ul>
<h3 id="4062-reduce_only_conflict">-4062 REDUCE_ONLY_CONFLICT</h3>
<ul>
<li>Invalid or improper reduceOnly value.</li>
<li>仅减仓的设置不正确。</li>
</ul>
<h3 id="4063-invalid_options_request_type">-4063 INVALID_OPTIONS_REQUEST_TYPE</h3>
<ul>
<li>Invalid options request type</li>
<li>无效的期权请求类型</li>
</ul>
<h3 id="4064-invalid_options_time_frame">-4064 INVALID_OPTIONS_TIME_FRAME</h3>
<ul>
<li>Invalid options time frame</li>
<li>无效的期权时间窗口</li>
</ul>
<h3 id="4065-invalid_options_amount">-4065 INVALID_OPTIONS_AMOUNT</h3>
<ul>
<li>Invalid options amount</li>
<li>无效的期权数量</li>
</ul>
<h3 id="4066-invalid_options_event_type">-4066 INVALID_OPTIONS_EVENT_TYPE</h3>
<ul>
<li>Invalid options event type</li>
<li>无效的期权事件类型</li>
</ul>
<h3 id="4067-position_side_change_exists_open_orders">-4067 POSITION_SIDE_CHANGE_EXISTS_OPEN_ORDERS</h3>
<ul>
<li>Position side cannot be changed if there exists open orders.</li>
<li>如果有挂单，无法修改仓位方向。</li>
</ul>
<h3 id="4068-position_side_change_exists_quantity">-4068 POSITION_SIDE_CHANGE_EXISTS_QUANTITY</h3>
<ul>
<li>Position side cannot be changed if there exists position.</li>
<li>如果有仓位, 无法修改仓位方向。</li>
</ul>
<h3 id="4069-invalid_options_premium_fee">-4069 INVALID_OPTIONS_PREMIUM_FEE</h3>
<ul>
<li>Invalid options premium fee</li>
<li>无效的期权费</li>
</ul>
<h3 id="4070-invalid_cl_options_id_len">-4070 INVALID_CL_OPTIONS_ID_LEN</h3>
<ul>
<li>Client options id is not valid.</li>
<li>客户的期权ID不合法</li>
<li>Client options id length should be less than 32 chars</li>
<li>客户的期权ID长度应该小于32个字符</li>
</ul>
<h3 id="4071-invalid_options_direction">-4071 INVALID_OPTIONS_DIRECTION</h3>
<ul>
<li>Invalid options direction</li>
<li>期权的方向无效</li>
</ul>
<h3 id="4072-options_premium_not_update">-4072 OPTIONS_PREMIUM_NOT_UPDATE</h3>
<ul>
<li>premium fee is not updated, reject order</li>
<li>期权费没有更新</li>
</ul>
<h3 id="4073-options_premium_input_less_than_zero">-4073 OPTIONS_PREMIUM_INPUT_LESS_THAN_ZERO</h3>
<ul>
<li>input premium fee is less than 0, reject order</li>
<li>输入的期权费小于0</li>
</ul>
<h3 id="4074-options_amount_bigger_than_upper">-4074 OPTIONS_AMOUNT_BIGGER_THAN_UPPER</h3>
<ul>
<li>Order amount is bigger than upper boundary or less than 0, reject order</li>
</ul>
<h3 id="4075-options_premium_output_zero">-4075 OPTIONS_PREMIUM_OUTPUT_ZERO</h3>
<ul>
<li>output premium fee is less than 0, reject order</li>
</ul>
<h3 id="4076-options_premium_too_diff">-4076 OPTIONS_PREMIUM_TOO_DIFF</h3>
<ul>
<li>original fee is too much higher than last fee</li>
<li>期权的费用比之前的费用高 </li>
</ul>
<h3 id="4077-options_premium_reach_limit">-4077 OPTIONS_PREMIUM_REACH_LIMIT</h3>
<ul>
<li>place order amount has reached to limit, reject order</li>
<li>下单的数量达到上限</li>
</ul>
<h3 id="4078-options_common_error">-4078 OPTIONS_COMMON_ERROR</h3>
<ul>
<li>options internal error</li>
<li>期权内部系统错误</li>
</ul>
<h3 id="4079-invalid_options_id">-4079 INVALID_OPTIONS_ID</h3>
<ul>
<li>invalid options id</li>
<li>invalid options id: %s</li>
<li>duplicate options id %d for user %d</li>
<li>期权ID无效</li>
</ul>
<h3 id="4080-options_user_not_found">-4080 OPTIONS_USER_NOT_FOUND</h3>
<ul>
<li>user not found</li>
<li>user not found with id: %s</li>
<li>用户找不到</li>
</ul>
<h3 id="4081-options_not_found">-4081 OPTIONS_NOT_FOUND</h3>
<ul>
<li>options not found</li>
<li>options not found with id: %s</li>
<li>期权找不到</li>
</ul>
<h3 id="4082-invalid_batch_place_order_size">-4082 INVALID_BATCH_PLACE_ORDER_SIZE</h3>
<ul>
<li>Invalid number of batch place orders.</li>
<li>Invalid number of batch place orders: %s</li>
<li>批量下单的数量不正确</li>
</ul>
<h3 id="4083-place_batch_orders_fail">-4083 PLACE_BATCH_ORDERS_FAIL</h3>
<ul>
<li>Fail to place batch orders.</li>
<li>无法批量下单</li>
</ul>
<h3 id="4084-upcoming_method">-4084 UPCOMING_METHOD</h3>
<ul>
<li>Method is not allowed currently. Upcoming soon.</li>
<li>方法不支持</li>
</ul>
<h3 id="4085-invalid_notional_limit_coef">-4085 INVALID_NOTIONAL_LIMIT_COEF</h3>
<ul>
<li>Invalid notional limit coefficient</li>
<li>期权的有限系数不正确</li>
</ul>
<h3 id="4086-invalid_price_spread_threshold">-4086 INVALID_PRICE_SPREAD_THRESHOLD</h3>
<ul>
<li>Invalid price spread threshold</li>
<li>无效的价差阀值</li>
</ul>
<h3 id="4087-reduce_only_order_permission">-4087 REDUCE_ONLY_ORDER_PERMISSION</h3>
<ul>
<li>User can only place reduce only order</li>
<li>用户只能下仅减仓订单</li>
</ul>
<h3 id="4088-no_place_order_permission">-4088 NO_PLACE_ORDER_PERMISSION</h3>
<ul>
<li>User can not place order currently</li>
<li>用户当前不能下单</li>
</ul>
<h3 id="4104-invalid_contract_type">-4104 INVALID_CONTRACT_TYPE</h3>
<ul>
<li>Invalid contract type</li>
<li>无效的合约类型</li>
</ul>
<h3 id="4114-invalid_client_tran_id_len">-4114 INVALID_CLIENT_TRAN_ID_LEN</h3>
<ul>
<li>clientTranId  is not valid</li>
<li>clientTranId不正确</li>
<li>Client tran id length should be less than 64 chars</li>
<li>客户的tranId长度应该小于64个字符</li>
</ul>
<h3 id="4115-duplicated_client_tran_id">-4115 DUPLICATED_CLIENT_TRAN_ID</h3>
<ul>
<li>clientTranId  is duplicated</li>
<li> clientTranId重复</li>
<li>Client tran id should be unique within 7 days</li>
<li>客户的tranId应在7天内唯一</li>
</ul>
<h3 id="4118-reduce_only_margin_check_failed">-4118 REDUCE_ONLY_MARGIN_CHECK_FAILED</h3>
<ul>
<li>ReduceOnly Order Failed. Please check your existing position and open orders</li>
<li>仅减仓订单失败。请检查现有的持仓和挂单</li>
</ul>
<h3 id="4131-market_order_reject">-4131 MARKET_ORDER_REJECT</h3>
<ul>
<li>The counterparty's best price does not meet the PERCENT_PRICE filter limit</li>
<li>交易对手的最高价格未达到PERCENT_PRICE过滤器限制</li>
</ul>
<h3 id="4135-invalid_activation_price">-4135 INVALID_ACTIVATION_PRICE</h3>
<ul>
<li>Invalid activation price</li>
<li>无效的激活价格</li>
</ul>
<h3 id="4137-quantity_exists_with_close_position">-4137 QUANTITY_EXISTS_WITH_CLOSE_POSITION</h3>
<ul>
<li>Quantity must be zero with closePosition equals true</li>
<li>数量必须为0，当closePosition为true时</li>
</ul>
<h3 id="4138-reduce_only_must_be_true">-4138 REDUCE_ONLY_MUST_BE_TRUE</h3>
<ul>
<li>Reduce only must be true with closePosition equals true</li>
<li>Reduce only 必须为true，当closePosition为true时</li>
</ul>
<h3 id="4139-order_type_cannot_be_mkt">-4139 ORDER_TYPE_CANNOT_BE_MKT</h3>
<ul>
<li>Order type can not be market if it's unable to cancel</li>
<li>订单类型不能为市价单如果不能取消</li>
</ul>
<h3 id="4140-invalid_opening_position_status">-4140 INVALID_OPENING_POSITION_STATUS</h3>
<ul>
<li>Invalid symbol status for opening position</li>
<li>无效的交易对状态</li>
</ul>
<h3 id="4141-symbol_already_closed">-4141 SYMBOL_ALREADY_CLOSED</h3>
<ul>
<li>Symbol is closed</li>
<li>交易对已下架</li>
</ul>
<h3 id="4142-strategy_invalid_trigger_price">-4142 STRATEGY_INVALID_TRIGGER_PRICE</h3>
<ul>
<li>REJECT: take profit or stop order will be triggered immediately</li>
<li>拒绝：止盈止损单将立即被触发</li>
</ul>
<h3 id="4144-invalid_pair">-4144 INVALID_PAIR</h3>
<ul>
<li>Invalid pair</li>
<li>无效的pair</li>
</ul>
<h3 id="4161-isolated_leverage_reject_with_position">-4161 ISOLATED_LEVERAGE_REJECT_WITH_POSITION</h3>
<ul>
<li>Leverage reduction is not supported in Isolated Margin Mode with open positions</li>
<li>逐仓仓位模式下无法降低杠杆</li>
</ul>
<h3 id="4164-min_notional">-4164 MIN_NOTIONAL</h3>
<ul>
<li>Order's notional must be no smaller than 5.0 (unless you choose reduce only)</li>
<li> 订单的名义价值不可以小于5，除了使用reduce only</li>
<li>Order's notional must be no smaller than %s (unless you choose reduce only)</li>
<li> 订单的名义价值不可以小于<code>%s</code>，除了使用reduce only</li>
</ul>
<h3 id="4165-invalid_time_interval">-4165 INVALID_TIME_INTERVAL</h3>
<ul>
<li>Invalid time interval</li>
<li>无效的间隔</li>
<li>Maximum time interval is %s days</li>
<li>最大的时间间隔为 <code>%s</code> 天</li>
</ul>
<h3 id="4183-price_highter_than_stop_multiplier_up">-4183 PRICE_HIGHTER_THAN_STOP_MULTIPLIER_UP</h3>
<ul>
<li>Price is higher than stop price multiplier cap.</li>
<li>止盈止损订单价格不应高于触发价与报价乘数上限的乘积</li>
<li>Limit price can't be higher than %s.</li>
<li>止盈止损订单价格不应高于 <code>%s</code></li>
</ul>
<h3 id="4184-price_lower_than_stop_multiplier_down">-4184 PRICE_LOWER_THAN_STOP_MULTIPLIER_DOWN</h3>
<ul>
<li>Price is lower than stop price multiplier floor.</li>
<li>止盈止损订单价格不应低于触发价与报价乘数下限的乘积</li>
<li>Limit price can't be lower than %s.</li>
<li>止盈止损订单价格不应低于 <code>%s</code>f</li>
</ul>

      </div>
      <div class="dark-box">
      </div>
    </div>
    <script>
      const LG = document.getElementById('LG');
      const lang_btn = document.getElementById('lang_box');
      const btn_spot = document.getElementById('btn_spot');
      const btn_dm = document.getElementById('btn_dm');
      const btn_fp = document.getElementById('btn_fp');
      const btn_tn = document.getElementById('btn_tn');
      const v1_url = document.getElementById('v1_url');
      //const v2_url = document.getElementById('v2_url');
      const url = GetUrlRelativePath();
      if(url.indexOf('cn') != -1){
        // for the Chinese Language env.
        lang_btn.innerHTML = 'English';
        btn_spot.innerHTML = '现货/杠杆/币安宝/矿池';
        btn_dm.innerHTML = 'U本位合约';
        btn_fp.innerHTML = '币本位合约';
        btn_tn.innerHTML = '欧式期权';
        LG.href = "https://www.binance.com/cn/";
        lang_btn.href = url.replace('cn/', 'en/');
        btn_spot.href = btn_spot.href.replace('en/', 'cn/');
        btn_dm.href = btn_dm.href.replace('en/', 'cn/');
        btn_fp.href = btn_fp.href.replace('en/', 'cn/');
        btn_tn.href = btn_tn.href.replace('en/', 'cn/');
        //v1_url.href = '/docs/spot/v1/cn/';
        //v2_url.href = '/docs/spot/v2/cn/';
      }else{
        // for the English Language env.
        lang_btn.innerHTML = '简体中文';
        btn_spot.innerHTML = 'Spot/Margin/Savings/Mining';
        btn_dm.innerHTML = 'USDⓈ-M Futures';
        btn_fp.innerHTML = 'COIN-M  Futures';
        btn_tn.innerHTML = 'Vanilla Options';
        LG.href = "https://www.binance.com/en/";
        lang_btn.href = url.replace('en/', 'cn/');
        btn_spot.href = btn_spot.href.replace('cn/', 'en/');
        btn_dm.href = btn_dm.href.replace('cn/', 'en/');
        btn_fp.href = btn_fp.href.replace('cn/', 'en/');
        btn_tn.href = btn_tn.href.replace('cn/', 'en/');
        //v1_url.href = '/docs/spot/v1/en/';
        //v2_url.href = '/docs/spot/v2/en/';
      }
      if(location.href.indexOf('apidocs/futures') > 0){
        btn_spot.className = '';
        btn_dm.className = 'current';
        btn_fp.className = '';
        btn_tn.className = '';
      } else if(location.href.indexOf('apidocs/spot') > 0){
        btn_spot.className = 'current';
        btn_dm.className = '';
        btn_fp.className = '';
        btn_tn.className = '';
      } else if(location.href.indexOf('apidocs/voptions') > 0){
        btn_spot.className = '';
        btn_dm.className = '';
        btn_fp.className = '';
        btn_tn.className = 'current';
      } else{
        btn_spot.className = '';
        btn_dm.className = '';
        btn_fp.className = 'current';
        btn_tn.className = '';
      }
      // language botton
      lang_btn.style.display = 'block';
      function GetUrlRelativePath(){
        let url = document.location.toString();
        let arrUrl = url.split("//");
        let start = arrUrl[1].indexOf("/");
        let relUrl = arrUrl[1].substring(start);
        if(relUrl.indexOf("?") != -1){
          relUrl = relUrl.split("?")[0];
        }
        if(relUrl.indexOf("#") != -1){
          relUrl = relUrl.split("#")[0];
        }
        return relUrl;
  　　}
    </script>
  

</body></html>